PC Review Forums Software General Software Help with Microsoft Access Form Design.

Reply
 
Thread Tools Rate Thread
Old 04-07-2009, 05:43 PM   #1
spike250
New Member
 
spike250's Avatar
 
Join Date: Sep 2008
Posts: 7
Trader Rating: (0)
Cool Help with Microsoft Access Form Design.

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 by spike250 : 04-07-2009 at 05:50 PM.
spike250 is offline   Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off