Casper2012
Registered User.
- Local time
- Today, 13:52
- Joined
- Aug 10, 2011
- Messages
- 23
I was wondering if there was a way to run a parameter query and have the results open up in a form?
Thanks for any help anyone could pass along!
If Me.RecordSet.RecordCount = 0 Then
MsgBox "The parameter you entered had no results, please try again"
DoCmd.Close acForm, "YourFormName"
End If
I tried the code and I am getting a Syntax error:
DoCmd.Close acForm. "Contact Details"
Any ideas?
Buit can the same results come from the search button I created on my form? Can it search the query and return the result like you metioned before?
Me.Combo2 = Null
Me.Combo4 = Null
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
Dim stDocName As String
Dim stLinkCriteria As String
[COLOR="Purple"] If IsNull(Me.Combo2) And IsNull(Me.Combo4) Then
MsgBox "please make a selection from one of the Combo Boxes"
Me.Combo2.SetFocus
Exit Sub
End If[/COLOR]
stDocName = "FRM_ResultMain2"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click
End Sub