dialog box that sets up data in a form

J

jim jackle

Here's a good one. I am wanting to create a whopper of a
dialog box. When I start a new record in my main form I
want a dailog to automaticly open. I want it to prompt
basic questions and parameters. I want it to ask the
following:

"1. what is your work order number? _______"(the input is
a 6 digit text/number)
"2. How many times has this part been inspected?___"
"3. What is the action of this part; Accepted, Rejected,
Varience, or Hold? __" input the initial of the action.

I want it to take all three answers and create a unique
Inspection number with hyphens as seperators for each
segment of the output. This will be a unique "serial"
number of each inspection and will be inserted into a
specific field (which is also giving me fits). (Isn't
Statistical Process Control fun?)I am having a bit of a
time with the programming and the expressions.

I want it to prompt who you (the inspector) are, what
format (inches or MM). It will then fill in the relative
fields. This though is simple, if I can get the above
problem working.

I type it all out the "serial" number manually in one
field and then type out each answer in their own fields
(effectively typing everything twice). I may soon have
another person(s) using this form so I'd like to make it
fool-proof.
Thanks in advance for the gutsy person who can help!!!!
 
K

Ken Snell

There are many ways you can do this, including using InputBox and a dialog
form. If you use a dialog (popup) form, just put three controls on the form
with labels that ask the questions and let the user fill in the info. If you
use InputBox, you can run code that asks the questions one after the other.

You could run code like this on the OnCurrent event of the form:

Private Sub Form_Current()
Dim strWONumber As String, strInspect As String, strAction as String
Dim strInspNumber As String
If Me.NewRecord = True Then
strWONumber = InputBox("What is your work order number?")
strInspect = InputBox("How many times has it been inspected?")
strAction = InputBox("What is the action?")
strInspNumber = strWONumber & "-" & strInspect & "-" & _
strAction
Me.FieldName.Value = strInspNumber
End If
End Sub

Obviously, the above has no validation of entries or error-checking. That is
left as an exercise for the reader.
 

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