List box update

hudaz

Registered User.
Local time
Today, 19:54
Joined
Jan 22, 2013
Messages
28
Hi all,

I'm having an issue at the moment with list boxes and if anyone would be able to cast their eyes over this I'd be eternally grateful!.

Essentially I have a form_A with several tab's and then one list control box in each of those tabs. At present if you double click on any item within the control boxes your taken to another form_B with info about that item and when you close that from down again if refreshes form_A.

Is it possible to only refresh the specific list control box that is active instead of refreshing the whole form ?

Thanks for your help :-D
 
Have you tried using the OpenArgs argument of the DoCmd.OpenForm method? That way you can requery the control that opened the Form.
 
Have you tried using the OpenArgs argument of the DoCmd.OpenForm method? That way you can requery the control that opened the Form.

No i've not. Would you be able to give me a quick example of what the argument would look like and i'll give it a go asap!

Thanks for your help so far

Cheers
 
Try typing Docmd.Openform and hitting F1
 
Something along the lines of.
Code:
Private Sub yourFirstListBoxName_DblClick(Cancel As Integer)
    DoCmd.OpenForm "FormB", OpenArgs:="yourFirstListBoxName"
End Sub

Private Sub yourSecondListBoxName_DblClick(Cancel As Integer)
    DoCmd.OpenForm "FormB", OpenArgs:="yourSecondListBoxName"
End Sub
In the FormB's On Close event and On Load,
Code:
Dim lstName As String

Private Sub Form_Load()
    lstName = Nz(Me.OpenArgs, "NA")
End Sub

Private Sub Form_Close()
    If lstName <> "NA" Then Forms("FormA").Controls(lstName).Requery
Ens Sub
NOTE: Code not tested !
 

Users who are viewing this thread

Back
Top Bottom