VBA to only show records that relate to an ID (1 Viewer)

YNWA

Registered User.
Local time
Today, 22:54
Joined
Jun 2, 2009
Messages
905
Right I think I have this working with this code:

Private Sub Form_Open(Cancel As Integer)
If Nz(Me.OpenArgs, vbNullString) <> vbNullString Then
Me.Text0.RowSource = "Select MeterID, ContractID, MeterRef" _
& " From STORE_Meter_Refs Where ContractID=" & Me.OpenArgs _
& " Order By MeterRef;"
End If
End Sub

So the query I made to pull through other fields to automatically populate fields, I should be able to replace the table name (STORE...) with the query name?
 

YNWA

Registered User.
Local time
Today, 22:54
Joined
Jun 2, 2009
Messages
905
Changed to query and I think that works now.

I only see the relating MEter Ref and the afterupdate event pulls other fields in.

Thanks for all your help.
 

Users who are viewing this thread

Top Bottom