Skipping straight to a subform

Local time
Yesterday, 19:18
Joined
Jul 29, 2005
Messages
62
Hi

I've searched the forum but haven't come across this kind of problem.

I'm creating a sale and inventory system for my mates shop. My sales form is a main for frmSalesOrders this has Order no. Date and Totals, and then I have one subform frmSalesOrdersSubform with the sales data on.

My problem is that the people using the system are used to an old system where they would skip straight to the sales data but if they do this on my form then it comes up with the error message "Index or Primary key cannot contain null value"
The three fields in my main report are automated:
SalesNumber - Autonumber
SalesDate - Will be linked by an update event
TotalValue - Sum of subform

Is there a way I can auto generate the record on the main form on entry so they can skip straight to the subform. I had two thoughts
1) some kind of code on the OnOpen event, but I couldn't come up with something that would work
2) Maybe hide the subform and have it made visible by a button on the main form and also have the update code for the date on here?

However, I'm not sure how to make either work, any ideas greatly apreciated
Thanks.
 
Answered my own question

I linked my date column to the forms OnCurrent record
[SODate] = Date

This updates the date on entrey to the form, which in turn creates a record key.
Might get some sleep tonight after all.
 
It's ok, I have no calculated data in my table, if theres one thing I've learned above all others in this forum is that you don't want to be storing calculated values :eek:

the total is purely as a reference on the form and is not actually stored anywhere, the calculation itself does occur in the footer.

Oh well 1 problem down only a hundred or so left to go...
:)
 

Users who are viewing this thread

Back
Top Bottom