Access Help with Microsoft Access Form Design.

Joined
Sep 6, 2008
Messages
8
Reaction score
0
Hi,

I have created a form in Access with the following VBA code;

Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
If userid = "" Then
MsgBox ("YOU CANNOT ADD A NEW RECORD AT THIS TIME AS YOU DIDNT PROVIDE YOUR INITIALS!")
Exit Sub
End If
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
Date = Day(Now()) & "/" & Month(Now()) & "/" & Year(Now())
author = userid
Me.AllowAdditions = False
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub

Private Sub Form_Load()
DoCmd.Maximize
userid = InputBox("PLEASE ENTER YOUR INITIALS TO PROCEED!", "User Id")
Command4.SetFocus
End Sub

It works to the point that it asks you to type in your initials to proceed, but I cannot get it to add that information to a field in the form.

Can someone please help?

Thanks
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top