Trouble with lookup

G

Guest

Hi!
In my components table, I got rid of the ID field and used the description
as the primary key. The prm.Value = Eval(prm.Name) statement now has
a value of "[Component]" for prm.Name instead of the actual string value of
the component. When I was using an ID, prm.Name had the value
Forms![NewVideoSystem]![Receiver] . What has happened? Please help.
Thanks!

If Nz(Forms![NewVideoSystem]![Receiver], False) <> False Then
If Forms![NewVideoSystem]![Components] = True Then
rst.AddNew
rst![Customer ID] = Forms![NewVideoSystem]![Customer ID]
rst![Type] = "Component"
rst![System] = Forms![NewVideoSystem]![System]
rst![Level] = Forms![NewVideoSystem]![Equip Level]
rst![Room] = Forms![NewVideoSystem]![Equip Room]
rst![Component] = Forms![NewVideoSystem]![Receiver]
Set qry = CurrentDb.CreateQueryDef("", "SELECT [Supplier], [Part
No], [Unit Cost] FROM [Component Lookup] WHERE [Component] =
Forms![NewVideoSystem]![Receiver]")
For Each prm In qry.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rst2 = qry.OpenRecordset
rst![Supplier] = rst2![Supplier]
rst![Part No] = rst2![Part No]
rst![Unit Cost] = rst2![Unit Cost]
rst![Status] = "PO Pending"
rst![Date Required] = Forms![NewVideoSystem]![Date Required]
rst![Qty] = 1
rst![Notes] = "A/V Receiver"
rst.Update
End If 'Components
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top