form filter and coomand button

J

JRS

Hi - I created a parameter query called Form Query and then created a form
called Program Information and it uses the form query to populate. I put a
command button on the form to refresh or run the parameter form query right
from the form so the user could be prompted for the new selection. When I
hit the button I am prompted as expected however I get a balnk screen...no
values or form fields, just the header. If I right click the command
button.....I see a red X next to remove filter sort. If I click that....the
form populates. I don't know why that is happening. I did a cut and paste
of the properties below. I would like the form to populate without having to
right click the command button. thank you



Private Sub Command68_Click()
On Error GoTo Err_Command68_Click

Dim stDocName As String

stDocName = "FORM QUERY"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command68_Click:
Exit Sub

Err_Command68_Click:
MsgBox Err.Description
Resume Exit_Command68_Click

End Sub
Private Sub Command71_Click()
On Error GoTo Err_Command71_Click


DoCmd.Quit

Exit_Command71_Click:
Exit Sub

Err_Command71_Click:
MsgBox Err.Description
Resume Exit_Command71_Click

End Sub
Private Sub Command73_Click()
On Error GoTo Err_Command73_Click


DoCmd.PrintOut

Exit_Command73_Click:
Exit Sub

Err_Command73_Click:
MsgBox Err.Description
Resume Exit_Command73_Click

End Sub
Private Sub Command74_Click()
On Error GoTo Err_Command74_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_Command74_Click:
Exit Sub

Err_Command74_Click:
MsgBox Err.Description
Resume Exit_Command74_Click

End Sub
Private Sub Command75_Click()
On Error GoTo Err_Command75_Click


DoCmd.Quit

Exit_Command75_Click:
Exit Sub

Err_Command75_Click:
MsgBox Err.Description
Resume Exit_Command75_Click

End Sub
Private Sub GROUP_NUMBER_ONLY_Click()
On Error GoTo Err_GROUP_NUMBER_ONLY_Click

Dim stDocName As String

stDocName = "FORM QUERY GROUP NUMBER ONLY"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_GROUP_NUMBER_ONLY_Click:
Exit Sub

Err_GROUP_NUMBER_ONLY_Click:
MsgBox Err.Description
Resume Exit_GROUP_NUMBER_ONLY_Click

End Sub
Private Sub query_by_group_number_only_Click()
On Error GoTo Err_query_by_group_number_only_Click

Dim stDocName As String

stDocName = "QUERY GROUP NUMBER ONLY"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_query_by_group_number_only_Click:
Exit Sub

Err_query_by_group_number_only_Click:
MsgBox Err.Description
Resume Exit_query_by_group_number_only_Click

End Sub
Private Sub Query_by_Group_Name_Click()
On Error GoTo Err_Query_by_Group_Name_Click

Dim stDocName As String

stDocName = "QUERY BY GROUP NAME"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Query_by_Group_Name_Click:
Exit Sub

Err_Query_by_Group_Name_Click:
MsgBox Err.Description
Resume Exit_Query_by_Group_Name_Click

End Sub
Private Sub Command85_Click()
On Error GoTo Err_Command85_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PROGRAM INFORMATION"

stLinkCriteria = "[PKG_NBR]=" & "'" & Me![PKG_NBR] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command85_Click:
Exit Sub

Err_Command85_Click:
MsgBox Err.Description
Resume Exit_Command85_Click

End Sub
Private Sub Command88_Click()
On Error GoTo Err_Command88_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PROGRAM INFORMATION"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command88_Click:
Exit Sub

Err_Command88_Click:
MsgBox Err.Description
Resume Exit_Command88_Click

End Sub
Private Sub Command89_Click()
On Error GoTo Err_Command89_Click

Dim stDocName As String

stDocName = "FORM QUERY"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command89_Click:
Exit Sub

Err_Command89_Click:
MsgBox Err.Description
Resume Exit_Command89_Click

End Sub
Private Sub open_the_form_Click()
On Error GoTo Err_open_the_form_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PROGRAM INFORMATION"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_open_the_form_Click:
Exit Sub

Err_open_the_form_Click:
MsgBox Err.Description
Resume Exit_open_the_form_Click

End Sub
Private Sub Command91_Click()
On Error GoTo Err_Command91_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PROGRAM INFORMATION"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command91_Click:
Exit Sub

Err_Command91_Click:
MsgBox Err.Description
Resume Exit_Command91_Click

End Sub
Private Sub Command93_Click()
On Error GoTo Err_Command93_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PROGRAM INFORMATION"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command93_Click:
Exit Sub

Err_Command93_Click:
MsgBox Err.Description
Resume Exit_Command93_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top