Can I do this?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am wondering how I differentiate between two input boxes in the same event.
I have one input box fire, the user enters the string which populates
correctly into the table the form is using as a source. Then I want another
input box to fire and populate a different field. Is it possible?

Thank you
 
Jeff said:
I am wondering how I differentiate between two input boxes in the
same event. I have one input box fire, the user enters the string
which populates correctly into the table the form is using as a
source. Then I want another input box to fire and populate a
different field. Is it possible?

Thank you

If you are populating fields in the active form's RecordSource why use
InputBoxes at all? Why not just provide TextBoxes?

Anyway; I suppose you could prompt with any number of InputBox() calls and place
the response of each into a different field if you wanted to. What part of that
process do you have a question about? I mean *you* are writing the code so each
step should know which field each response should go into.
 
I just have not worked with code like this much and was having a problem
getting the inputs to work right. But I finally got it to work. I built a
departmental survey and by stealing fields from the record source each input
box has a customised message asking the question and returning the answer to
the correct field in the table.

Dim Answer As Integer
Dim Acct
Set Acct = New ADODB.Recordset

Acct.Open "Accounting", CurrentProject.Connection, adOpenStatic

Do Until Acct.EOF

Me.AcctQID = Acct![Q_ID]

Dim MyQ As String
MyQ = Acct![Question]

Dim CurDept As String
CurDept = Acct![Department_Name]

Answer = InputBox("On a scale of 1 to 5, with 5 being the best," & vbCrLf &
vbCrLf & "Please rate your opinion of the following:" & vbCrLf & vbCrLf &
MyQ, "Rate The Level Of Service for" & " " & CurDept)

MyInput.Value = [Answer]
AcctQID.Value = [QID]

Dim AddComment As String

[Comment] = InputBox("Please add any comments you would like to make
concerning:" & " " & vbCrLf & vbCrLf & MyQ, "Add A Comment About" & " " &
CurDept)

DoCmd.Save
Acct.MoveNext

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

DoCmd.GoToRecord , , acNewRec

Loop

By playing around with it all day I finally guessed correctly that just
assigning the field to the inputbox works.

Thanks Rick
 

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

Back
Top