MattLongmuir
Technical User
Hi Team,
Sadly, i'm still going to be a complete newbie for another few weeks - so try not to laugh at my insanely easy questions! (haha!)
Ok, here's the deal (basically):
tblTrainee
- FirstName (text field)
- LastName (text field)
frmAddTrainee
- txtfname (unbound text box)
- txtlname (unbound text box)
- cmdAdd (command button)
Simply enough, i want to be open the form, type in a users first and last names into those 2 text boxes, hit save and have the txt boxes populate their appropriate fields in the tblTrainee. Simple..or so i thought.
Here's an example of my code:
"Private Sub cmdAdd_Click()
Dim sSql As String
sSql = " INSERT INTO tblTrainee ( FirstName ) SELECT '" & Me("txtfname"
& "'"
DoCmd.SetWarnings False
DoCmd.RunSQL sSql
DoCmd.SetWarnings True
End Sub"
Seems to work - i don't get any errors. However, the table doesn't populate!?
Can anyone help (either by supplying totally different code or by modifying my own)??
Also, as a side note, is there a way to remove the record er, toolbar from the bottom of a form? I think i read somewhere that you can't - if so that's ok. Would be cool if you could though.
Thanks in advance!
Sadly, i'm still going to be a complete newbie for another few weeks - so try not to laugh at my insanely easy questions! (haha!)
Ok, here's the deal (basically):
tblTrainee
- FirstName (text field)
- LastName (text field)
frmAddTrainee
- txtfname (unbound text box)
- txtlname (unbound text box)
- cmdAdd (command button)
Simply enough, i want to be open the form, type in a users first and last names into those 2 text boxes, hit save and have the txt boxes populate their appropriate fields in the tblTrainee. Simple..or so i thought.
Here's an example of my code:
"Private Sub cmdAdd_Click()
Dim sSql As String
sSql = " INSERT INTO tblTrainee ( FirstName ) SELECT '" & Me("txtfname"
DoCmd.SetWarnings False
DoCmd.RunSQL sSql
DoCmd.SetWarnings True
End Sub"
Seems to work - i don't get any errors. However, the table doesn't populate!?
Can anyone help (either by supplying totally different code or by modifying my own)??
Also, as a side note, is there a way to remove the record er, toolbar from the bottom of a form? I think i read somewhere that you can't - if so that's ok. Would be cool if you could though.
Thanks in advance!