C
Combo box type - help
Hi.. I have a problem.. I have a form where i created a button to click when
i want the form data to be inputed on the respective table.. I don't want to
use the macro button for that because i want to add some routines to it,
before the "next record" part. As you can see:
Private Sub Command17_Click()
Text15.SetFocus
If Text15.Text = Empty Then
MsgBox "ERRO: Empty field"
Else
Text40.SetFocus
If Text40.Text = Empty Then
MsgBox "ERRO: Empty field"
Else
Combo34.SetFocus
If Combo34.Text = Empty Then
MsgBox "ERRO: Empty field"
Else
Combo35.SetFocus
If Combo35.Text = Empty Then
MsgBox "ERRO: Empty field"
Else
DoCmd.GoToRecord , , acNext
If MsgBox("New Record?", vbOKQuit, "Next:") = vbOK Then
Else
Quit
End If
End If
End If
End If
End If
End If
End Sub
Before sending the new values, on the form, to the tables i check if every
combobox and textbox are filled. Only then the values are sent to the
table..the problem is that the program is not working right. The values are
being sent to the table but the table places are not being incremented.. I
will explain what happens, everytime i press the button the values are sent
to the same place on the table, so, the previews values are substituted by
the new ones.. i want my button to work exactly as the "Next Record" button
on the down tab!
What do i need to add to my programming so it works?
Thanks
Nuno
i want the form data to be inputed on the respective table.. I don't want to
use the macro button for that because i want to add some routines to it,
before the "next record" part. As you can see:
Private Sub Command17_Click()
Text15.SetFocus
If Text15.Text = Empty Then
MsgBox "ERRO: Empty field"
Else
Text40.SetFocus
If Text40.Text = Empty Then
MsgBox "ERRO: Empty field"
Else
Combo34.SetFocus
If Combo34.Text = Empty Then
MsgBox "ERRO: Empty field"
Else
Combo35.SetFocus
If Combo35.Text = Empty Then
MsgBox "ERRO: Empty field"
Else
DoCmd.GoToRecord , , acNext
If MsgBox("New Record?", vbOKQuit, "Next:") = vbOK Then
Else
Quit
End If
End If
End If
End If
End If
End If
End Sub
Before sending the new values, on the form, to the tables i check if every
combobox and textbox are filled. Only then the values are sent to the
table..the problem is that the program is not working right. The values are
being sent to the table but the table places are not being incremented.. I
will explain what happens, everytime i press the button the values are sent
to the same place on the table, so, the previews values are substituted by
the new ones.. i want my button to work exactly as the "Next Record" button
on the down tab!
What do i need to add to my programming so it works?
Thanks
Nuno