Adding items to a list box

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

Guest

I have a frmMain that has several yes/no checkboxes on it. How would I be
able to take the items that the user selects and populate a listbox/textbox
on another form.

What I am trying to do is create a check form that has all the selections
that the user has entered. A way to check and ensure the data is accurate
before moving to the next record.

Possible?
Thanks in advance!
 
Assuming that the checkboxes are called ckSomething, ckSomethingElse,
etc., you could use code along these lines in the form's BeforeUpdate
event procedure. If you need something fancier than a messagebox, you
can pass strSelection to a form by using the OpenArgs argument of
DoCmd.OpenForm, and retrieve it in the form's Open event procedure.


Dim strSelections As String

If Me.ckSomething Then
strSelections = strSelections & "Something" & vbCrLf
End If
If Me.ckSomethingElse Then
strSelections = strSelections & "Something Else" & vbCrLf
End If
...

If MsgBox "You have selected " & vbCrLf & vbCrLf _
& strSelections & vbCrLf & vbCrLf & "Is that correct?", _
& vbOkCancel & vbQuestion, "Confirm selection" _
<> vbOK Then
Cancel = True
End If
 

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

Similar Threads

Access Cannot select items in listbox 1
List Box Question 4
Getting Query Record Count into Text Box 5
Subform Issues 1
List Boxes - Access 2003 0
add entry to list box 4
Dropdown List Box is Null 1
Subform/Query Criteria 2

Back
Top