Mansoor Ahmad
Registered User.
- Local time
- Today, 15:14
- Joined
- Jan 20, 2003
- Messages
- 140
Dear All
Here is a full code that I am using and I am sure I have messed it up a lot since this morning.
The way I want it to work is that on click of a button, it asks user to input data and then filter the records for this data and opens in form view.
In this condition it does open the form but does not filter the records
Can somebody please look at it and tell me where I am wrong?
Thanks
Public Function GetData(strMessage As String) As String
InputBox strMessage, "Result"
End Function
Private Sub Cmdformview_Click()
Call formview("F_Formview")
End Sub
Private Sub formview(frmName As String)
Dim stwhere As String
Dim myInt As String
myInt = GetData("GIVE WR NO")
stwhere = "[WR LABEL] = '" & myInt & "'"
Call OpenForm(frmName, stwhere)
End sub
Public Function OpenForm(frmName As String, stwhere As String)
DoCmd.OpenForm (frmName), acNormal, , stwhere
End Function
Here is a full code that I am using and I am sure I have messed it up a lot since this morning.
The way I want it to work is that on click of a button, it asks user to input data and then filter the records for this data and opens in form view.
In this condition it does open the form but does not filter the records
Can somebody please look at it and tell me where I am wrong?
Thanks
Public Function GetData(strMessage As String) As String
InputBox strMessage, "Result"
End Function
Private Sub Cmdformview_Click()
Call formview("F_Formview")
End Sub
Private Sub formview(frmName As String)
Dim stwhere As String
Dim myInt As String
myInt = GetData("GIVE WR NO")
stwhere = "[WR LABEL] = '" & myInt & "'"
Call OpenForm(frmName, stwhere)
End sub
Public Function OpenForm(frmName As String, stwhere As String)
DoCmd.OpenForm (frmName), acNormal, , stwhere
End Function