I have a form called "frm_Vendors" that lets you select a vendor from a combobox and then displays the vendors details. I would like to open another form called "frm_NewPurchase" that opens to a new record, but autofills the "VendorNo" text box with the "VendorID" from the previous form. Can this be done?
That worked great to bring up the proper vendor but it autofilled the rest of the form with the last record. Is there a way to have it open to a new record while diplaying the VendorNo?
That worked great to bring up the proper vendor but it autofilled the rest of the form with the last record. Is there a way to have it open to a new record while diplaying the VendorNo?
Generally, "NewRec" means exactly what it says - a new record with nothing in it EXCEPT default values (when specified.) Of course, both the tabledef and the form's controls can individually specify default values.
Generally, "NewRec" means exactly what it says - a new record with nothing in it EXCEPT default values (when specified.) Of course, both the tabledef and the form's controls can individually specify default values.
Not being at the computer to try it - but what I'm getting at is can you cycle the records with the navigation controls? 1=0 is a way of preventing that. Think of it like a memory optimization. Next time I'm at the computer I'll just have to try both ways.
Not being at the computer to try it - but what I'm getting at is can you cycle the records with the navigation controls? 1=0 is a way of preventing that. Think of it like a memory optimization. Next time I'm at the computer I'll just have to try both ways.
Normally, you won't use a WhereCondition or Filter, but you could test that too and let us know what you find out. I haven't tried it, so I don't know the real answer.
Well I'll tell you what, I just tested OpenForm WHERE 1=0 against OpenForm with no where condition but with the acFormAdd Data Mode, and the results are surprising.
This opens the form with a filter enabled on the navigation bar. You can undo the filter and cycle the records:
I am going to change my code to acFormAdd as logic would dictate that it is more efficient. In addition, I am going to disable my "New" button on the form when a record is opened by selecting it from the record list (that opens with a filter for that record), so that users can not start a new record using the form with the full recordset loaded. There is no difference in speed on my 4.6 Ghz system loading off of an SSD, but there may be a difference with 10 users and a back end on the network.