L Lamb2087 Registered User. Local time Today, 18:52 Joined Feb 7, 2003 Messages 103 Feb 12, 2003 #1 How would I make a command button that would run an update query. In the command button wizard I did not see anything that would do this. Can some one tell me the code to put in on the VB side to make this work. Query called: UpdateRiflesQuery
How would I make a command button that would run an update query. In the command button wizard I did not see anything that would do this. Can some one tell me the code to put in on the VB side to make this work. Query called: UpdateRiflesQuery
Hayley Baxter Registered User. Local time Today, 18:52 Joined Dec 11, 2001 Messages 1,607 Feb 12, 2003 #2 Using the wizard choose Miscellaneous and Run Query.
L Lamb2087 Registered User. Local time Today, 18:52 Joined Feb 7, 2003 Messages 103 Feb 12, 2003 #3 Dialog Box Hayley: What code could I put in the vb side that will give the user the option of yes proceed or no do not proceed. Thanks In Advance!
Dialog Box Hayley: What code could I put in the vb side that will give the user the option of yes proceed or no do not proceed. Thanks In Advance!
Hayley Baxter Registered User. Local time Today, 18:52 Joined Dec 11, 2001 Messages 1,607 Feb 12, 2003 #4 cmdButton_OnClick() Dim Response as Integer Response = MsgBox("Do you wish to continue?", vbYesNo, "Update Query") If Response = vbNo Then 'User chose no Exit Sub Else 'User chose yes End If Let me know if that's ok for you, if not I can maybe send you a little something to look at.
cmdButton_OnClick() Dim Response as Integer Response = MsgBox("Do you wish to continue?", vbYesNo, "Update Query") If Response = vbNo Then 'User chose no Exit Sub Else 'User chose yes End If Let me know if that's ok for you, if not I can maybe send you a little something to look at.
L Lamb2087 Registered User. Local time Today, 18:52 Joined Feb 7, 2003 Messages 103 Feb 12, 2003 #5 Here is the delete code Hayley: Here is the code generated by the wizard to run the query. Do I substitute what you sent me? Private Sub cmdDCadets_Click() On Error GoTo Err_cmdDCadets_Click Dim stDocName As String stDocName = "DeleteCadetIdQuery" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_cmdDCadets_Click: Exit Sub Err_cmdDCadets_Click: MsgBox Err.Description Resume Exit_cmdDCadets_Click End Sub
Here is the delete code Hayley: Here is the code generated by the wizard to run the query. Do I substitute what you sent me? Private Sub cmdDCadets_Click() On Error GoTo Err_cmdDCadets_Click Dim stDocName As String stDocName = "DeleteCadetIdQuery" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_cmdDCadets_Click: Exit Sub Err_cmdDCadets_Click: MsgBox Err.Description Resume Exit_cmdDCadets_Click End Sub