Populate data from list back to form (1 Viewer)

a4aj

Registered User.
Local time
Today, 07:44
Joined
Jan 10, 2007
Messages
16
I am trying to pull the data from a table back to the form by double clicking on a n item in a list.I am unable to do it.I have zipped an example. Can anyone please please guide me? Thanks !

THis is my code for my work.

Private Sub lst_OrderDetail_DblClick(Cancel As Integer)

Set myDB = CurrentDb
Set myRS = myDB.OpenRecordset("tbl_QuoteInfo")

On Error Resume Next

If (lst_OrderDetail.ListCount = 0) Then
MsgBox "There are no job details for this quote to retrieve", vbInformation

Else


Do While Not myRS.EOF


If Me.txtQuoteNumber.Value = myRS.Fields("Quote #") Then
myRS.MoveFirst
myRS.Move (lst_OrderDetail.ListIndex)
Me.txtMarkNum.Value = myRS.Fields("Mark#")
Me.txtOpenings.Value = myRS.Fields("# of Openings")
Me.txtUnits.Value = myRS.Fields("# of Units")
Me.cmbProdDesc.Value = myRS.Fields("Product Description")
Me.txtWidth.Value = myRS.Fields("Dimension_W")
Me.txtHeight.Value = myRS.Fields("Dimension_H")
Me.cmbFinish.Value = myRS.Fields("Finish Type")
Me.cmbGlassDesc.Value = myRS.Fields("Glass Description")
Me.cmbScreen.Value = myRS.Fields("Screen Type")
Me.cmbTrim.Value = myRS.Fields("Trim Type")
Me.cmbFh.Value = myRS.Fields("Flange Head")
Me.cmbFj.Value = myRS.Fields("Flange Jamb")
Me.cmbFs.Value = myRS.Fields("Flange Sill")
Me.txtacce.Value = myRS.Fields("Accessories")

End If
myRS.MoveNext
Loop

End If

Set myDB = Nothing
Set myRS = Nothing
End Sub
 

Attachments

  • list.zip
    15.8 KB · Views: 88

rborob

Registered User.
Local time
Today, 07:44
Joined
Jun 6, 2006
Messages
116
wanna tell us what the links on the tables are? i only see one
 

a4aj

Registered User.
Local time
Today, 07:44
Joined
Jan 10, 2007
Messages
16
The link in the zip file or in the code I pasted? Zip file has only link to the table.
 

Users who are viewing this thread

Top Bottom