Help

marklane2001

Registered User.
Local time
Today, 15:30
Joined
Sep 16, 2008
Messages
15
I currently havex2 forms - frm1 and frm 2

frm1 has a listbox called lst1 which is connected to a table called tblInvoiceAll

there are 3 fields in the listbox which are PupilID, ClassID and TermID. clicking on a slection in the lst1 opens frm2.

A selection is made from a pupil list (another form) which opens frm1 and lst1 only displays records for that pupil ie. by pupil ID

What I want to happen is when I select a record from lst1 I want to open frm 2 and I want x3 text boxes (say txtPupilID, txtClassID and txtTermID) in that form to display the pupilID, CLAssID and TermID of that selection.

frm2 is not currently linked to a table as I think if I link it to tblInvoiceAll it won't allow me to update when running an insert query from frm2.
 
I would add a select button to frm1...doing so allows for changing ones mind...if you add it to the ON CLICK of the listbox the user will have to close frm2 and come back if they made the wrong selection...

On the ON CLICK event of the button - you should be able to do something like this...

DoCmd.OpenForm "frm2", acNormal, "", "", , acNormal
Forms![frm2]![text0] = Me.List0.Column(1)
Forms![frm2]![text1] = Me.List0.Column(2)
Forms![frm2]![text2] = Me.List0.Column(3)

Keeping in mind...me.list0 would be me.yourlistname and [frm2]![text*] would be [frm2]![yourfieldname]

Hope this helps
 

Users who are viewing this thread

Back
Top Bottom