J
jmo
Can someone pls help me with this code as its driving me nuts...
I have a table named Junction Table1 which has 4 fields: Owner ID, Owner
Card ID, Part1, Part2
I run select query from VBA with 2 parameters getting values from a
listbox (Forms![Owner Card]!lbOwners) and a textbox (Forms![Owner Card]!
txtOwnerCardID)
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT [Junction Table1].* FROM
[Junction Table1] WHERE ((([Junction Table1].[Owner ID])=" & Forms![Owner
Card]!lbOwners & ") And (([Junction Table1].[Owner card ID])=" & Forms!
[Owner Card]!txtOwnerCardID & "));")
rs.Edit
rs.Fields("Part1") = CInt(s1) 's1 and s2 are collected from user
rs.Fields("Part2") = CInt(s2)
rs.Update
rs.Close
Set rs = Nothing
Upon inspecting opened recordset it turns out it has only one field
(Owner ID) where it should have 4 fields as i'm selecting all fields from
table. I KNOW SQL STRING IS CORRECT as it works fine in Access 2007!
Help!!!!
I have a table named Junction Table1 which has 4 fields: Owner ID, Owner
Card ID, Part1, Part2
I run select query from VBA with 2 parameters getting values from a
listbox (Forms![Owner Card]!lbOwners) and a textbox (Forms![Owner Card]!
txtOwnerCardID)
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT [Junction Table1].* FROM
[Junction Table1] WHERE ((([Junction Table1].[Owner ID])=" & Forms![Owner
Card]!lbOwners & ") And (([Junction Table1].[Owner card ID])=" & Forms!
[Owner Card]!txtOwnerCardID & "));")
rs.Edit
rs.Fields("Part1") = CInt(s1) 's1 and s2 are collected from user
rs.Fields("Part2") = CInt(s2)
rs.Update
rs.Close
Set rs = Nothing
Upon inspecting opened recordset it turns out it has only one field
(Owner ID) where it should have 4 fields as i'm selecting all fields from
table. I KNOW SQL STRING IS CORRECT as it works fine in Access 2007!
Help!!!!