Hi All
I have spent the last 2 hours trying to troubleshoot this problem. Please help.
I have a form with 3 combo boxes where a user selects information they want loaded on a second form.
Form A has site, builidng and facility represented by these combo boxes.
When the user clicks load facility info, the idea is that the second form Form B opens with the filtered info.
I have the following code running on Form A on the button click event
The event is causing a type mismatch error
If the WHERE criteria in the open even is run one condition at a time, the form opens. When i connect them all together with "And" the even fails.
I have checked the data types in the underlying table of Form B (which is a bound form) and no problems are noticed.
I prefer this method over the idea of a sub form so I really would like this to work.
Please help. This is quite urgent.
I have spent the last 2 hours trying to troubleshoot this problem. Please help.
I have a form with 3 combo boxes where a user selects information they want loaded on a second form.
Form A has site, builidng and facility represented by these combo boxes.
When the user clicks load facility info, the idea is that the second form Form B opens with the filtered info.
I have the following code running on Form A on the button click event
Private Sub cmdfacmgmt_Click()
If ValidateRecord = False Then
Cancel = True
Else
Dim stLinkCriteria, stLinkCriteria1, stLinkCriteria2 As String
stLinkCriteria = "[Community]=" & "'" & Me![cmbcomm] & "'"
stLinkCriteria1 = "[Building]=" & "'" & Me![cmbbldg] & "'"
stLinkCriteria2 = "[Facility]=" & "'" & Me![cmbfac] & "'"
DoCmd.OpenForm "Fac_Mgmt", , , stLinkCriteria And stLinkCriteria1 And stLinkCriteria2
End If
End Sub
The event is causing a type mismatch error
If the WHERE criteria in the open even is run one condition at a time, the form opens. When i connect them all together with "And" the even fails.
I have checked the data types in the underlying table of Form B (which is a bound form) and no problems are noticed.
I prefer this method over the idea of a sub form so I really would like this to work.
Please help. This is quite urgent.