L
ladybug via AccessMonster.com
I have a code that I found that I am trying to modify to my database. This
is the code:
Private Sub Command15_Click()
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
I have a form with two combo boxes. The first one is cboSearch where you
select an Employee. The second is Text22 where you select a weekrange. Once
both selections are made the on click code for the command button has this
Event Procedure and it opens another form. I want the Employee and Weekrange
selected in the first form, to populate when opening the second form.
Right now with the code above it is only reading the WeekRange. No matter
what EmployeeName I select it only shows the first Employee name from my
table.
Any suggestions?
is the code:
Private Sub Command15_Click()
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
I have a form with two combo boxes. The first one is cboSearch where you
select an Employee. The second is Text22 where you select a weekrange. Once
both selections are made the on click code for the command button has this
Event Procedure and it opens another form. I want the Employee and Weekrange
selected in the first form, to populate when opening the second form.
Right now with the code above it is only reading the WeekRange. No matter
what EmployeeName I select it only shows the first Employee name from my
table.
Any suggestions?