Subject: Auto Number query again
Posted By: Brendan Bartley Post Date: 8/22/2006 10:58:24 AM
Hi All again
I have set up my main form customer details and my sub form auto number and other details
When I have logged details against a customer I want to click a command button and clear the details and save the record
When I try to do this I get a error message with the auto number what can I do to stop this.
Thanks

Brendan Bartley
Reply By: mmcdonal Reply Date: 8/22/2006 11:51:41 AM
I don't know what you mean by "clear the details and save the record."

Normally you have a main form and sub form, and the subform keeps records related to the main form record.

It sounds like you want to add records to the sub form related to the main form, then click a button which clears the data entry you just did, and then saves the data somewhere else. Is this correct? If so, why?

The autonumber field error in this case would be because you are taking a number from one table/field (on your sub form?) and trying to push it into another table's autonumber field. You can't do this. auto means auto. If you want to save the auto number generated in the first sub form, change the autonumber field in the second table to Number (integer).

Does this help?


mmcdonal
Reply By: Brendan Bartley Reply Date: 8/22/2006 11:56:05 AM
Thanks for you're reply
No there is only one auto number in the sub form.
I want to insert a submit button that clears all the records from the sub form
this includes the auto number
Thanks

Brendan Bartley
Reply By: mmcdonal Reply Date: 8/22/2006 11:59:39 AM
I am not sure why you are clearing records from a subform. What is the table that the form is built on?

I would take the PK (autonumber) field in a variable, then do

DELETE FROM tblYourSubFormTable WHERE [PK] = PKfromSubForm

Don't delete it from the sub form, delete it from the underlying table.

Does this help?

mmcdonal
Reply By: mankoti_mankoti2000 Reply Date: 8/26/2006 6:09:06 AM
hello, sir
I have a field naming Diary_number it is autonumber, it start from 1 but i want to start my diary number from 1401, is it possible or not, if it is possible then please help me and tell me how



Go to topic 48693

Return to index page 193
Return to index page 192
Return to index page 191
Return to index page 190
Return to index page 189
Return to index page 188
Return to index page 187
Return to index page 186
Return to index page 185
Return to index page 184