Help with OpenArgs function (1 Viewer)

jonnywakey

Registered User.
Local time
Today, 05:57
Joined
Feb 2, 2009
Messages
33
Hi All

I have a form "Disposition" which has a field called "JobID", the format of the JobID field is prefixed with "XXX-XXX-"000 and is an autonumber field resulting in XXX-XXX-001 in the field.

I am trying to use the OpenArgs function to pass this value to a field on a form called "frmReports", I have the following code behind a click event on cmd button on form "Disposition":-

Private Sub Command156_Click()
DoCmd.OpenForm "frmResults", , , , , , Me.JobID

End Sub

On the "frmResults" form on load event I have the following code:-

Private Sub Form_Load()
Me.Lab_Ref_No = Me.OpenArgs


End Sub

The Lab_Ref_No field = 1, is there any way of copying the format across to force this field to read XXX-XXX-001

Thanks in advance

Jonny
 

AlexHedley

Registered User.
Local time
Today, 05:57
Joined
Aug 28, 2012
Messages
171
Have you added any Format to [Lab_Ref_No]?
Just replicate from your original Form.

You could use the Format Painter and copy it over or just add it manually.
 

jdraw

Super Moderator
Staff member
Local time
Today, 00:57
Joined
Jan 23, 2006
Messages
15,379
This link may provide info
 

Users who are viewing this thread

Top Bottom