Help
im currently trying to create a piece of vba code that will open a query get the single record returned by the query and copy the record from the query to the fields of a form which is a sub-form on another form. Basicly when i try and run the code (see below) it stops at the * with a run time error 3061, basicly i was able to pin point it back to the query. The query needs 6 fields of info from the main form and 1 field from the subform in question.
Basicly the error is telling me code is expecting 7 parameters (the 7 required fields in the query) and is getting 0. do i need to pass the fields from the forms into the function as you would in say c++, if so how? otherwise what am i missing?
Private Sub Item_No_AfterUpdate()
Set db = CurrentDb()
* Set rs = db.OpenRecordSet("item_incrementer")
Me.Supplier = rs![Supplier]
Me.Quantity = rs![Quantity]
Me.Status = rs![Status]
Me.Due_Date = rs![Due Date]
Me.Category = rs![Category]
Me.W_O_No = rs![W/O No]
Me.P_O_No = rs![P/O No]
Me.P_O_Line_No = rs![P/O Line No]
End Sub
im currently trying to create a piece of vba code that will open a query get the single record returned by the query and copy the record from the query to the fields of a form which is a sub-form on another form. Basicly when i try and run the code (see below) it stops at the * with a run time error 3061, basicly i was able to pin point it back to the query. The query needs 6 fields of info from the main form and 1 field from the subform in question.
Basicly the error is telling me code is expecting 7 parameters (the 7 required fields in the query) and is getting 0. do i need to pass the fields from the forms into the function as you would in say c++, if so how? otherwise what am i missing?
Private Sub Item_No_AfterUpdate()
Set db = CurrentDb()
* Set rs = db.OpenRecordSet("item_incrementer")
Me.Supplier = rs![Supplier]
Me.Quantity = rs![Quantity]
Me.Status = rs![Status]
Me.Due_Date = rs![Due Date]
Me.Category = rs![Category]
Me.W_O_No = rs![W/O No]
Me.P_O_No = rs![P/O No]
Me.P_O_Line_No = rs![P/O Line No]
End Sub