Problem with Code OnCLick a control on continuous forms

connerlowen

Registered User.
Local time
Yesterday, 19:42
Joined
May 18, 2015
Messages
204
Hi,

I have a database that is going to be used to enter data for Quotations and generate Quotations. The function of generating new quotations is working okay, but there are other things my boss wants the database to do. There are three continuous forms that all have a look-up function, but I want to be able to click on a record and it do a certain command.

Form one I want to click on the "QuotationNumber" field and the database opens another form where the QuotationID in that form equals the QuotationID on the continuous form. This is basically to go in and edit any data within the Quotation.

Form two has two check box fields, "OrderRecieved", and "OrderVoid". If I click on the Order Received check box I want that check box within the table "NewQuotationT" to be checked and I want the database to ask for a Quantity which is also a field in the table "NewQuotationT". The Form is based off of a Read Only Query because of the Left Join. If I click on the Order Void check box I want one of two things to happen. 1. the record is deleted completely from the database which will in turn delete all of the records in related tables, however my Boss wants there to be a reason stored somewhere in the database as to why the quote was voided according to quotation Number. 2. check that check box in the table "NewQuotationT" and I want the database to ask for a reason the Quotation was voided which is a field in the table "NewQuotationT".

Form three I want to be able to click on the "QuotaitonNumber" field and basically fun the calculations for the Quotation based on the most recent metal market prices. These prices should be entered daily by a user, but if they are not, I want the database to take the last entered price. The database should generate a new Record in all of the related tables with all of the same data as the selected Quotation, but a new QuotationNumber and the updated Prices. After the Queries are ran, the Database should finish this function by generating the actual quotation in report format and exporting to either Work or PDF.

Thank you in advance for any help you may offer. If there is any more needed information, please ask.

Regards,

Conner Owen
 
You're cramming too many questions in one thread Conner. It's typically one thread per question so that it remains focussed on a topic.
Form one I want to click on the "QuotationNumber" field and the database opens another form where the QuotationID in that form equals the QuotationID on the continuous form.
Look into the WHERE argument of the OpenForm method. pbaldy explains it here:
http://www.baldyweb.com/wherecondition.htm

Form two has two check box fields, "OrderRecieved", and "OrderVoid". If I click on the Order Received check box I want that check box within the table "NewQuotationT" to be checked and I want the database to ask for a Quantity which is also a field in the table "NewQuotationT". The Form is based off of a Read Only Query because of the Left Join.
If I click on the Order Void check box I want one of two things to happen:
1. the record is deleted completely from the database which will in turn delete all of the records in related tables, however my Boss wants there to be a reason stored somewhere in the database as to why the quote was voided according to quotation Number.
2. check that check box in the table "NewQuotationT" and I want the database to ask for a reason the Quotation was voided which is a field in the table "NewQuotationT".
Highlighted in red indicates a design problem, either in your tables or in the form itself. It shouldn't be read-only by design. Review how you've set it up and perhaps look into using subforms.

Form three I want to be able to click on the "QuotaitonNumber" field and basically fun the calculations for the Quotation based on the most recent metal market prices. These prices should be entered daily by a user, but if they are not, I want the database to take the last entered price.
Do a DLookup() check on the table using Date() as the criteria and if the record exists, you can use that record. Otherwise, create a query to return the record with the Max() date.
 

Users who are viewing this thread

Back
Top Bottom