Appending sequencial numbers into a table ...

  • Thread starter Thread starter John DOE
  • Start date Start date
J

John DOE

Hi:

I need a form that basically has a text box that allows the user to enter a
number, say 1-25. On that form will be 3 radio buttons; yesterday, today
and tomorrow. After the user enters the number, the user must then click
one of the 3 radio buttons.

The text box that has that number, I want to modify before appending into
the table. Instead of appending 5 (if the user entered 5 of course)
records, I want to add the word "Export" to appear before the number. If
the number entered is less or equal to 9, put a 0 ( zero) before the number.

e.g.

Export01
Export02
Export03
Export04
Export05

Can anyone help me with this please.

Thanks
 
Hi, John.
I want to add the word "Export" to appear before the number. If the
number entered is less or equal to 9, put a 0 ( zero) before the number.

Just use the Format( ) function to format the string. Try:

. . . ' Other code precedes.

If (Nz(Me!txtExport.Value, "") = "") Then
MsgBox "Please assign a number to the Export text box.", _
vbCritical + vbOKOnly, "Cannot Procede!"
Exit Sub
Else
sExportNum = Format(Me!txtExport.Value, "Export" & "00")
End If

. . . ' And more code follows.

.. . . where txtExport is the name of the text box, and sExportNum is the
string variable that will be used to insert the export number into the
proper field in the table when the record is added.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
Back
Top