S
Sarella
I'm very new to this coding business, but with the help of these pages have
managed to concoct the code below.
Myname = Me.Text0
If IsNull(Me.Text0) Then
MsgBox "Enter Initials"
Else
DoCmd.OpenForm "Loginformdata", , , , , acHidden
DoCmd.GoToRecord acForm, "Loginformdata", acNewRec
Forms!loginformdata![UserName] = Myname
DoCmd.Close acForm, "Loginformdata"
DoCmd.Close acForm, "Login box"
MsgBox "Welcome to The Contractor Database"
DoCmd.OpenForm "switchboard"
End Sub
I have a table called Usergroups
A form with 3 fields (username, date, time) which updates the table called
"Loginformdata",
Another form with a textbox (text0) and a command button2
The above code is on the command button - on click
What i want to happen is on starting the DB, user enter's their initials,
and the table is updated with initials date/time. This works fine.
If they don't enter anything in the text box, and then presses the command
button it all falls over and the debugger starts at the line "Myname =
Me.Text0"
What have I done wrong??? Please help!
managed to concoct the code below.
Myname = Me.Text0
If IsNull(Me.Text0) Then
MsgBox "Enter Initials"
Else
DoCmd.OpenForm "Loginformdata", , , , , acHidden
DoCmd.GoToRecord acForm, "Loginformdata", acNewRec
Forms!loginformdata![UserName] = Myname
DoCmd.Close acForm, "Loginformdata"
DoCmd.Close acForm, "Login box"
MsgBox "Welcome to The Contractor Database"
DoCmd.OpenForm "switchboard"
End Sub
I have a table called Usergroups
A form with 3 fields (username, date, time) which updates the table called
"Loginformdata",
Another form with a textbox (text0) and a command button2
The above code is on the command button - on click
What i want to happen is on starting the DB, user enter's their initials,
and the table is updated with initials date/time. This works fine.
If they don't enter anything in the text box, and then presses the command
button it all falls over and the debugger starts at the line "Myname =
Me.Text0"
What have I done wrong??? Please help!