Combo Box Problem

Robbyp2001

Registered User.
Local time
Today, 17:48
Joined
Oct 8, 2011
Messages
143
Hello folks.

I have a question for one of the gurus on here. Imagine an Access form that contains a Combo box (say Combo20) that has a number of options available for selection. However, option 13 "additional info" is the only one that prompts for further action. The other options do nothing upon selection other populate the box and store the value.

What I'd like to know is, is it possible, upon selection of option 13 only, a pop-up form can be produced and additional info entered, whilst retaining the ID value in the underlying table. This form does not appear for any other option.

There is no room on the main form to embed this additional information permanently, thus the need for a pop-up to appear only upon selection of '13'.

I hope that I've given enough information here and I look forward to the experts coming up with a solution as always!

Rob
 
On the after update event of the combo you could test for the value of the combo and if it is 13, open the pop up form where the user makes an edit to the data for that record. I assume that you have a textbox on the form that will show the additional info for the appropriate column of the combo.

When user clicks save or close on the pop up, use the unload event of the popup form to requery the combo back on the original form and you probably want to requery the original form as well.

I remember a sample database where the combo was used to add additional info - don't know if it is still available.
 
Last edited:
Hi Jeanette, Many thanks for your prompt reply. This sounds exactly what I need. Unfortunately I do not know the code required to achieve this 'after update'. If you happen to come across a sample dbase where this function applies, please let me know.
 
I have a similar arrangement sort of ish
So your control on your main form could be Combo20 (get into the habit of Naming things with relevant terms, it really helps)
I have chosen "3" that is the PK no. in my db for this popup req form

Private Sub Combo20_LostFocus()
If Me.Combo20 = "" Or IsNull(Me.Combo20) Then
MsgBox "Mandatory Field. A Name is Required"
Exit Sub
End If
If Me.Combo20 = "3" Then
DoCmd.OpenForm "frmPopUp", acNormal
End If
End Sub

Then in your popup you can push the value back into your main form like this
OnExit of ControlAdd
Private Sub ControlAdd_Exit(Cancel As Integer)
Forms!frmMain.Controltobeupdated = Forms!frmPopUp.ControlAdd
End Sub
you need to leave the main form open and close your popup after but this could be done by cmdClose after ControlAdd


get back if you have a question
 
Gaccess

Many thanks for your kind help. I'll try this immediately.

Regards

Rob
 

Users who are viewing this thread

Back
Top Bottom