123dstreet
Registered User.
- Local time
- Today, 13:46
- Joined
- Apr 14, 2010
- Messages
- 122
I have a form (form1) which will open another form (form2) and apply a filter using a filter button already on form 2. I have applied the following code which works properly for 2 of the 3 forms this needs to be done on:
The below line 'Call Forms.[RMA Data].Command40_Click' works for both BT200 and STB100, but returns an error for BT100 'Object doesn't support this property or method'.
I'm guessing there's a setting on the BT100 form preventing this filter from running, any ideas???
The below line 'Call Forms.[RMA Data].Command40_Click' works for both BT200 and STB100, but returns an error for BT100 'Object doesn't support this property or method'.
I'm guessing there's a setting on the BT100 form preventing this filter from running, any ideas???
Code:
Private Sub Command99_Click()
On Error GoTo Err_Command99_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim strRMA As String
Dim strProduct As String
Dim strSN As String
'set SN variable from Support log record
If IsNull(Me.wstSN) = False Then strSN = Me.wstSN
If IsNull(Me.wstSN) = True Then
MsgBox "Nothing to show for this unit."
Exit Sub
End If
'determine product
strProduct = Me.Product
If strProduct = "BT100" Then GoTo BT100
If strProduct = "BT200" Then GoTo BT200
If strProduct = "STB100" Then GoTo STB100
Exit Sub
BT100:
stDocName = "RMA Data"
DoCmd.OpenForm stDocName
'set search criteria and run filter command from RMA form
Forms![RMA Data]![Text38] = strSN
Call Forms.[RMA Data].Command40_Click
DoCmd.GoToRecord , , acLast
Exit Sub
BT200:
stDocName = "RMABT200form"
DoCmd.OpenForm stDocName
'set search criteria and run filter command from RMA form
'Forms!RMABT200form![Text43] = strRMA
'Call Forms.RMABT200form.Command45_Click
'If IsNull(strSN) = False Then
Forms!RMABT200form![Text38] = strSN
Call Forms.RMABT200form.Command40_Click
'End If
DoCmd.GoToRecord , , acLast
Exit Sub
STB100:
stDocName = "RMASTB100form"
DoCmd.OpenForm stDocName
'set search criteria and run filter command from RMA form
Forms!RMASTB100form![Text38] = strSN
Call Forms.RMASTB100form.Command40_Click
DoCmd.GoToRecord , , acLast
Exit Sub