Gotorecord unfilled subform

kambeng02

New member
Local time
Today, 19:31
Joined
Sep 23, 2010
Messages
6
Good day all,

Ive created a form (customer) with a subform (product) in access.

The question is how can i make the form automatically navigate to customer that still didnt have any product, considering all the customer info has been filled?

I have made a query that shows all the customer that still doesnt have any product. Then i made a code at "on load event". This is the code

DoCmd.GoToRecord acDataQuery, "no product", acFirst

But when i try to run it, i get Runtime error 2046, gotorecord isn't available now

Thanks in advance
 
Here is code to go to a record in a form where the primary key is called 'CustomerID' ...
Code:
public sub GoToID(CustomerID as long)
  with me.recordsetclone
    .findfirst "CustomerID = " & CustomerID
    if not .nomatch then me.bookmark = .bookmark
  end with
end sub
Use your query it identify the CustomerID and use this code to make that customer current in the form.
 
Sounds like you want to filter the forms records to only show the records that have no data in the Product field. If so, then work on how to filter your records with that criteria. I would not make the form open up to the filtered records. I would add a command button that the user has to click to show only the records that are missing Product values. Then add another command button to unfilter the records [or use a combo box to allow the user to select if they want to filter the records or not].

Code:
Me.FilterOn = True
Me.Filter = ([Products] Is Null Or [Products]="")
 
thanks for the reply,
but it didnt work, its either i dont really understand or the code doesnt work

say i want to load the main form to the last record of the productid

I have tried to set the subform to load to the last record, but when i open the main form, it only goto the last record for the first customer id, not the last record of product id, how should i do it?
 

Users who are viewing this thread

Back
Top Bottom