Hi all,
I have a search input form, which has a command button which runs an append query in sql like so:
I want to add a piece of code that will prompt the user to fill in textbox Name_input, SAL_input, type, country, source and Phone before running query, i.e. all these text and combo boxes have to be filled before appending. Any help very much appreciated, Thanks in advance,
M-.
I have a search input form, which has a command button which runs an append query in sql like so:
Code:
Private Sub Append_Click()
Dim strSQL As String
DoCmd.SetWarnings False
strSQL = "INSERT INTO ma_enq ( A1, A2, A3, A4, NAME ) " & _
"SELECT [Forms]![Ma_search2]![Expr1] AS Expr1, [Forms]![Ma_search2]![Expr2] AS Expr2, [Forms]![Ma_search2]![Expr3] AS Expr3, [Forms]![Ma_search2]![postcode] AS Expr4, [Forms]![Ma_search2]![Name_input] AS Expr5; "
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End Sub
I want to add a piece of code that will prompt the user to fill in textbox Name_input, SAL_input, type, country, source and Phone before running query, i.e. all these text and combo boxes have to be filled before appending. Any help very much appreciated, Thanks in advance,
M-.