Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CUSTOM AUTO NUMBER ON FORM AND TABLE...

Status
Not open for further replies.

GoToGirl

Technical User
Jun 5, 2009
1
US
Please help...
Table: tblRMALog
Form: frmRMALog
Field: dtmDateNotified (default =Date$())
autRMA# (autRMA#-not displayed on form)
txtRMA#

My issue is i can not have an incremental number. But I need an auto generated number. I have the control source for txtRMA# in the form as

="C" & Format([dtmDateNotified],"yymmdd") & "-" & Right([autRMA#],1)

So the far right number is auto and only ranges from 0-9. This way the customer doesnt know how many Returns we have issued (just so you can understand the need for not having an incremental number).

This works in the form great!!! But that field is not saved in tblRMALog. I have tried to move the expression to the form's txtRMA# Default value, but then the autonumber section does not display or get put into the table. I tried to have the expression in the table, to just mimic the form, but i have yet to make that work.

Please HELP!!


 
Of course its not saved, the control source for the text box is not bound to the table.

First, change the control source back to the field in your table. Next, on the beforeinsert event for the form (on form open, or wherever its appropriate):

txtRMA.value = "C" & Format([dtmDateNotified],"yymmdd") & "-" & Right([autRMA#],1)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top