Urgent Help Need - Adding Date Selection to Main Form

T

tmdrake

I have created a Main Form with 4 comboxes where the user can select from one
of the comboxes or make mutiple selection from any of the four, then click
the "Select Button"; where the results are displayed on a subform.

This works fine, however I would like to add a combox for "Start Date" and
a combox for "End Date" to the Main Form. Where the user will have to select
a "start date" and a "end date", in combination with a selection from one or
more of the other 4 comboxes then click the "Select Button" for the results
for that date range to appear in the subform.


This is the code I am using to make the selection for the 4 comboxes, what
will I need to add to also include the date boxes?

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName] & "'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] & ""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL
End Sub


Help is greatly appreciated.
 
D

Douglas J. Steele

Something like:

If Not IsNull(Me![DateField]) Then
strSQL = strSQL & " AND [DateField] = " & _
Format(Me![LastName], "\#yyyy\-mm\-dd\#")
End If

Dates must be delimited with # characters, and must be in a format Access
will recognize. Unfortunately, dd/mm/yyyy isn't such a format.
 
T

tmdrake

I am receiving a Run-time Error '3075':

Syntax error in string in query expression 'True AND [SectionNumber] = 4430
And [Week Ending]=".

This is what the code looks like with you addition:

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName] & "'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] & ""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
If Not IsNull(Me![Week Ending]) Then
strSQL = strSQL & " AND [Week Ending] = '" & Format(Me![LastName],
"\#yyyy\-mm\-dd\#")
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL (**highlighted in
yellow**)
End Sub

Again Thanks for you help.


--
tmdrake


Douglas J. Steele said:
Something like:

If Not IsNull(Me![DateField]) Then
strSQL = strSQL & " AND [DateField] = " & _
Format(Me![LastName], "\#yyyy\-mm\-dd\#")
End If

Dates must be delimited with # characters, and must be in a format Access
will recognize. Unfortunately, dd/mm/yyyy isn't such a format.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


tmdrake said:
I have created a Main Form with 4 comboxes where the user can select from
one
of the comboxes or make mutiple selection from any of the four, then click
the "Select Button"; where the results are displayed on a subform.

This works fine, however I would like to add a combox for "Start Date"
and
a combox for "End Date" to the Main Form. Where the user will have to
select
a "start date" and a "end date", in combination with a selection from one
or
more of the other 4 comboxes then click the "Select Button" for the
results
for that date range to appear in the subform.


This is the code I am using to make the selection for the 4 comboxes, what
will I need to add to also include the date boxes?

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName] & "'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] & ""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL
End Sub


Help is greatly appreciated.
 
D

Douglas J. Steele

Could be due to the fact that you're trying to format the contents of
Me![LastName] as a date.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


tmdrake said:
I am receiving a Run-time Error '3075':

Syntax error in string in query expression 'True AND [SectionNumber] =
4430
And [Week Ending]=".

This is what the code looks like with you addition:

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName] & "'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] & ""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
If Not IsNull(Me![Week Ending]) Then
strSQL = strSQL & " AND [Week Ending] = '" & Format(Me![LastName],
"\#yyyy\-mm\-dd\#")
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL (**highlighted in
yellow**)
End Sub

Again Thanks for you help.


--
tmdrake


Douglas J. Steele said:
Something like:

If Not IsNull(Me![DateField]) Then
strSQL = strSQL & " AND [DateField] = " & _
Format(Me![LastName], "\#yyyy\-mm\-dd\#")
End If

Dates must be delimited with # characters, and must be in a format Access
will recognize. Unfortunately, dd/mm/yyyy isn't such a format.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


tmdrake said:
I have created a Main Form with 4 comboxes where the user can select
from
one
of the comboxes or make mutiple selection from any of the four, then
click
the "Select Button"; where the results are displayed on a subform.

This works fine, however I would like to add a combox for "Start Date"
and
a combox for "End Date" to the Main Form. Where the user will have to
select
a "start date" and a "end date", in combination with a selection from
one
or
more of the other 4 comboxes then click the "Select Button" for the
results
for that date range to appear in the subform.


This is the code I am using to make the selection for the 4 comboxes,
what
will I need to add to also include the date boxes?

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName] &
"'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] & ""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL
End Sub


Help is greatly appreciated.
 
T

tmdrake

Thanks for you help. This is partically working, the problem it is only
displaying the records that have the End Date. How do I have it retrieve all
the records between the Start Date and the End Date.

I quest what I am asking is should there be a "between" statement in there?

Again Thanks
--
tmdrake


Douglas J. Steele said:
Could be due to the fact that you're trying to format the contents of
Me![LastName] as a date.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


tmdrake said:
I am receiving a Run-time Error '3075':

Syntax error in string in query expression 'True AND [SectionNumber] =
4430
And [Week Ending]=".

This is what the code looks like with you addition:

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName] & "'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] & ""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
If Not IsNull(Me![Week Ending]) Then
strSQL = strSQL & " AND [Week Ending] = '" & Format(Me![LastName],
"\#yyyy\-mm\-dd\#")
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL (**highlighted in
yellow**)
End Sub

Again Thanks for you help.


--
tmdrake


Douglas J. Steele said:
Something like:

If Not IsNull(Me![DateField]) Then
strSQL = strSQL & " AND [DateField] = " & _
Format(Me![LastName], "\#yyyy\-mm\-dd\#")
End If

Dates must be delimited with # characters, and must be in a format Access
will recognize. Unfortunately, dd/mm/yyyy isn't such a format.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I have created a Main Form with 4 comboxes where the user can select
from
one
of the comboxes or make mutiple selection from any of the four, then
click
the "Select Button"; where the results are displayed on a subform.

This works fine, however I would like to add a combox for "Start Date"
and
a combox for "End Date" to the Main Form. Where the user will have to
select
a "start date" and a "end date", in combination with a selection from
one
or
more of the other 4 comboxes then click the "Select Button" for the
results
for that date range to appear in the subform.


This is the code I am using to make the selection for the 4 comboxes,
what
will I need to add to also include the date boxes?

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName] &
"'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] & ""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL
End Sub


Help is greatly appreciated.
 
D

Douglas J. Steele

Sure, if you've got both Start Date and End Date fields on your form, you
can certainly use a Between statement.

What you might want is:

If Not IsNull(Me![StartDate]) Then
strSQL = strSQL & " AND [Week Ending] >= '" & _
Format(Me![StartDate], "\#yyyy\-mm\-dd\#")
End If
If Not IsNull(Me![EndDate]) Then
strSQL = strSQL & " AND [Week Ending] <= '" & _
Format(Me![EndDate], "\#yyyy\-mm\-dd\#")
End If


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


tmdrake said:
Thanks for you help. This is partically working, the problem it is only
displaying the records that have the End Date. How do I have it retrieve
all
the records between the Start Date and the End Date.

I quest what I am asking is should there be a "between" statement in
there?

Again Thanks
--
tmdrake


Douglas J. Steele said:
Could be due to the fact that you're trying to format the contents of
Me![LastName] as a date.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


tmdrake said:
I am receiving a Run-time Error '3075':

Syntax error in string in query expression 'True AND [SectionNumber] =
4430
And [Week Ending]=".

This is what the code looks like with you addition:

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName] &
"'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] & ""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
If Not IsNull(Me![Week Ending]) Then
strSQL = strSQL & " AND [Week Ending] = '" & Format(Me![LastName],
"\#yyyy\-mm\-dd\#")
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL (**highlighted in
yellow**)
End Sub

Again Thanks for you help.


--
tmdrake


:

Something like:

If Not IsNull(Me![DateField]) Then
strSQL = strSQL & " AND [DateField] = " & _
Format(Me![LastName], "\#yyyy\-mm\-dd\#")
End If

Dates must be delimited with # characters, and must be in a format
Access
will recognize. Unfortunately, dd/mm/yyyy isn't such a format.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I have created a Main Form with 4 comboxes where the user can select
from
one
of the comboxes or make mutiple selection from any of the four, then
click
the "Select Button"; where the results are displayed on a subform.

This works fine, however I would like to add a combox for "Start
Date"
and
a combox for "End Date" to the Main Form. Where the user will have
to
select
a "start date" and a "end date", in combination with a selection
from
one
or
more of the other 4 comboxes then click the "Select Button" for the
results
for that date range to appear in the subform.


This is the code I am using to make the selection for the 4
comboxes,
what
will I need to add to also include the date boxes?

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName]
&
"'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] &
""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL
End Sub


Help is greatly appreciated.
 
T

tmdrake

You are great, Thank you so much, this works perfectly.
--
tmdrake


Douglas J. Steele said:
Sure, if you've got both Start Date and End Date fields on your form, you
can certainly use a Between statement.

What you might want is:

If Not IsNull(Me![StartDate]) Then
strSQL = strSQL & " AND [Week Ending] >= '" & _
Format(Me![StartDate], "\#yyyy\-mm\-dd\#")
End If
If Not IsNull(Me![EndDate]) Then
strSQL = strSQL & " AND [Week Ending] <= '" & _
Format(Me![EndDate], "\#yyyy\-mm\-dd\#")
End If


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


tmdrake said:
Thanks for you help. This is partically working, the problem it is only
displaying the records that have the End Date. How do I have it retrieve
all
the records between the Start Date and the End Date.

I quest what I am asking is should there be a "between" statement in
there?

Again Thanks
--
tmdrake


Douglas J. Steele said:
Could be due to the fact that you're trying to format the contents of
Me![LastName] as a date.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I am receiving a Run-time Error '3075':

Syntax error in string in query expression 'True AND [SectionNumber] =
4430
And [Week Ending]=".

This is what the code looks like with you addition:

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName] &
"'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] & ""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
If Not IsNull(Me![Week Ending]) Then
strSQL = strSQL & " AND [Week Ending] = '" & Format(Me![LastName],
"\#yyyy\-mm\-dd\#")
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL (**highlighted in
yellow**)
End Sub

Again Thanks for you help.


--
tmdrake


:

Something like:

If Not IsNull(Me![DateField]) Then
strSQL = strSQL & " AND [DateField] = " & _
Format(Me![LastName], "\#yyyy\-mm\-dd\#")
End If

Dates must be delimited with # characters, and must be in a format
Access
will recognize. Unfortunately, dd/mm/yyyy isn't such a format.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I have created a Main Form with 4 comboxes where the user can select
from
one
of the comboxes or make mutiple selection from any of the four, then
click
the "Select Button"; where the results are displayed on a subform.

This works fine, however I would like to add a combox for "Start
Date"
and
a combox for "End Date" to the Main Form. Where the user will have
to
select
a "start date" and a "end date", in combination with a selection
from
one
or
more of the other 4 comboxes then click the "Select Button" for the
results
for that date range to appear in the subform.


This is the code I am using to make the selection for the 4
comboxes,
what
will I need to add to also include the date boxes?

Private Sub Select_Click()
Dim strSQL As String

strSQL = "SELECT [tblHours_Worked].ProjectID, " _
& "[tblHours_Worked].DisciplineName, " _
& "[tblHours_Worked].SectionNumber, " _
& "[tblHours_Worked].LastName, " _
& "[tblHours_Worked].[FirstName], " _
& "[tblHours_Worked].[SLC Code], " _
& "[tblHours_Worked].[Week Ending], " _
& "[tblHours_Worked].[PHW], " _
& "[tblHours_Worked].[AHW] " _
& "FROM [tblHours_Worked] WHERE True"
If Not IsNull(Me![DisciplineName]) Then
strSQL = strSQL & " AND [DisciplineName] = '" & Me![DisciplineName]
&
"'"
End If
If Not IsNull(Me![SectionNumber]) Then
strSQL = strSQL & " AND [SectionNumber] = " & Me![SectionNumber] &
""
End If
If Not IsNull(Me![ProjectID]) Then
strSQL = strSQL & " AND [ProjectId] = '" & Me![ProjectID] & "'"
End If
If Not IsNull(Me![LastName]) Then
strSQL = strSQL & " AND [LastName] = '" & Me![LastName] & "'"
End If
Debug.Print strSQL
Me.frmHours_Worked_subform.Form.RecordSource = strSQL
End Sub


Help is greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top