Code

  • Thread starter Thread starter ladybug via AccessMonster.com
  • Start date Start date
L

ladybug via AccessMonster.com

I have a form with two combo boxes. This is EmployeeName and WeekRange.
Once these two selections are made a Command Button is clicked and the
entries for that particular Employee and Weekrange open up in the second form.
Currently only the date range is being linked. No matter what user is
selected it still shows up as the first user in the second form. Here is my
code below. If anyone can help please paste in the code. Thanks!!!

On Error GoTo Err_Command15_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Timesheet"

stLinkCriteria = "[EmployeeName]=" & "'" & Me![cboSearch] & "'"
stLinkCriteria = "[WeekRange]=" & "'" & Me![Text22] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
hi,
stLinkCriteria = "[EmployeeName]=" & "'" & Me![cboSearch] & "'"
stLinkCriteria = "[WeekRange]=" & "'" & Me![Text22] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
If you like to filter for both parameters, then you need a slightly
different condition:

stLinkCriteria = "[EmployeeName]=" & "'" & Me![cboSearch] & "'"
stLinkCriteria = stLinkCriteria & " AND " & _
"[WeekRange]=" & "'" & Me![Text22] & "'"



mfG
--> stefan <--
 
You are a genius!!!!!!!!!!!!!!!!!!!!! Thank you so much! You have made my
Monday!

Stefan said:
hi,
stLinkCriteria = "[EmployeeName]=" & "'" & Me![cboSearch] & "'"
stLinkCriteria = "[WeekRange]=" & "'" & Me![Text22] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
If you like to filter for both parameters, then you need a slightly
different condition:

stLinkCriteria = "[EmployeeName]=" & "'" & Me![cboSearch] & "'"
stLinkCriteria = stLinkCriteria & " AND " & _
"[WeekRange]=" & "'" & Me![Text22] & "'"

mfG
--> stefan <--
 
Back
Top