HELP! How do you save a form that contains dependent combos

WillJ

Registered User.
Local time
Today, 22:47
Joined
Oct 20, 2012
Messages
40
Hi Guys,

I'm a bit stuck.
I have two combo boxes one is called cmbRequestType and the other cmbRequestTo.
RequestTo has an After Update code that sources the data specific to the selection made in cmbRequesType.


I want to be able to store the completed form at the end of the users journey however am unsure how to do this by assigning a button, or whether a simple button would be able to store the record effectively.

Here is the dependent combo code;

Private Sub cboRequestType_AfterUpdate()
With Me.cbORequestTo
.Value = Null
.RowSource = ""
If Not IsNull(Me.cboRequestType) Then
Select Case Me.cboRequestType
Case "Local Authority"
.RowSource = "SELECT LocalAuthorityName As [Local Authority Name] FROM LocalAuthority ORDER BY LocalAuthorityName;"
Case "Company"
.RowSource = "SELECT CompanyName As [Company Name] FROM Company ORDER BY CompanyName;"
Case "Contacts"
.RowSource = "SELECT ContactFullName As [Contact Full Name] FROM Contacts ORDER BY ContactFullName;"
Case "Location"
.RowSource = "SELECT LocationPostcode As [Location Postcode] FROM Location ORDER BY LocationPostcode;"
Case "Events"
.RowSource = "SELECT EventName As [Event Name] FROM Events ORDER BY EventName;"
Case "Universities"
.RowSource = "SELECT UniversityName As [University Name] FROM Universities ORDER BY UniversityName;"
End Select
If .ListCount > 0 Then
.Value = .ItemData(0)
.SetFocus
.Dropdown
End If
End If
End With
End Sub

Once the user has finished their journey through them to click a button and save the record. My question is as follows;


  1. How do you create an OnClick event that stores all the information from the fields on the report whilst matching the corresponding row source value returned in the cmbRequestTo box i.e. XName, with XNames record number from it's original table.
Presently there is no control source allocated on any of the text, or combo boxes.

It's important as each request for which ever body needs to be monitored for our internal efficiency.



My intuition tells me I might have to rework how I've approached this. All help is greatly appreciated as allways THANKS!
 
It sounds like you are working with an unbound form but if you need to store the users actions throughout the form why don't you just create a table and bind all of the selects they make in the table. Bind your form to the table. You can also just user vba to save the values from the form into a table.
 

Users who are viewing this thread

Back
Top Bottom