Compressor
Registered User.
- Local time
- Today, 11:17
- Joined
- Sep 23, 2006
- Messages
- 118
Well.... I can't 
Structure of DB and relations is included in jpg.
I have created two separate parts for sales. One which is used for over the counter sales, and one which is used for sales and labour per case.
I've created two forms (a form with a subform) for the bottom ones. Whenever I am on the main form, I select a customer and click Add Sale I can just keep on adding sales to the customer without problems.
I've copied the two forms and renamed them to be used again for the tables in the top of the structure/image. I've changed the Data Source of the Forms of course to the correct ones. On the case info form (which in this case acts the same as the Mainform for the other situation) I have placed a button to be able to add a new sale to the case. Using the code:
which is the same as in the other situation, but of course the reference was changed to the new form as you can see. That still presented the same problem, so I build them from scratch.
At first I had based the forms on queries which matched with their corresponding clients/cases but I have removed that base temporarily and linked the forms to the tables directly since I started to doubt myself and started to think I might have mesed up on that end.
When the table is empty I can click the Add New sale button and the correct form with its subform appears. The value in the textbox SaleID is set to (AutoNumber), the value in the box TechID is set to the correct TechID number, I use =[Forms]![TechAdd]![TechID] for this. I can add one sale. Then the fun is over. Whenever I then try to add or view a sale I get the error message "You can't go to the specified record".
I really don't understand why this could be happening. I mean... I can add multiple calls to a client, multiple appointments to a call, multiple techcases to an appointment. So why can't I add multiple sales to a techcase?
This was the problem I was working on before the crash yesterday. And I've trying to find out why this happens for a pretty long time now, but without succes.
Can anyone help me please? Why can I keep adding and viewing sales in the bottom structure and NOT in the top structure while I am using the same structure, setup and code?

Structure of DB and relations is included in jpg.
I have created two separate parts for sales. One which is used for over the counter sales, and one which is used for sales and labour per case.
I've created two forms (a form with a subform) for the bottom ones. Whenever I am on the main form, I select a customer and click Add Sale I can just keep on adding sales to the customer without problems.
I've copied the two forms and renamed them to be used again for the tables in the top of the structure/image. I've changed the Data Source of the Forms of course to the correct ones. On the case info form (which in this case acts the same as the Mainform for the other situation) I have placed a button to be able to add a new sale to the case. Using the code:
Code:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenForm "CaseTotalProductsSaleAdd", acNormal, "", "", , acNormal
DoCmd.GoToRecord , , acNewRec
At first I had based the forms on queries which matched with their corresponding clients/cases but I have removed that base temporarily and linked the forms to the tables directly since I started to doubt myself and started to think I might have mesed up on that end.
When the table is empty I can click the Add New sale button and the correct form with its subform appears. The value in the textbox SaleID is set to (AutoNumber), the value in the box TechID is set to the correct TechID number, I use =[Forms]![TechAdd]![TechID] for this. I can add one sale. Then the fun is over. Whenever I then try to add or view a sale I get the error message "You can't go to the specified record".
I really don't understand why this could be happening. I mean... I can add multiple calls to a client, multiple appointments to a call, multiple techcases to an appointment. So why can't I add multiple sales to a techcase?
This was the problem I was working on before the crash yesterday. And I've trying to find out why this happens for a pretty long time now, but without succes.
Can anyone help me please? Why can I keep adding and viewing sales in the bottom structure and NOT in the top structure while I am using the same structure, setup and code?
Attachments
Last edited: