I have database created in postgreSql and working on front-end application using microsoft access forms. I want to send a query on a press of a button:
Private Sub Command5_Click()
Dim strSQL As String
strSQL = "INSERT INTO public_failedestimate (est_num,issue_date) SELECT est_num,issue_date FROM public_estimate WHERE est_num=1 ;"
DoCmd.RunSQL strSQL
End Sub
It works when debugging, but does not when i click the button. By the way, it located in button’s on click event. thx
What you have should work. If there is any possibility that the current record in the form’s bound record set is dirty, then you want to ensure that the record is written to the table BEFORE you run this code.
You can add these 3 lines of code right before your RunSQL command