If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
opening forms base on data
i'm using a macro to open a form with information that equals the information
in the form i'm in. Macro: Where Condition [VendorName]=[Forms]![frmInventoryOrder]![VendorName] This enables me to use the first form as a "look up" form. What I would like to do is if there is no matching data in the 2nd form that either: 1. msgbox would appear stating "customer does not exit would you like to add" OR 2. simply just open a blank form in the data entry mode. Is this possible? |
#2
|
|||
|
|||
opening forms base on data
John
Here's an alternate approach to consider ... You can use an unbound combobox in the header of your form to let the user pick the "customer". You can use that combobox's AfterUpdate event to load the form with the selected customer's data. You can use that combobox's NotInList event to see if the user wishes to add a new customer. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "john" wrote in message news i'm using a macro to open a form with information that equals the information in the form i'm in. Macro: Where Condition [VendorName]=[Forms]![frmInventoryOrder]![VendorName] This enables me to use the first form as a "look up" form. What I would like to do is if there is no matching data in the 2nd form that either: 1. msgbox would appear stating "customer does not exit would you like to add" OR 2. simply just open a blank form in the data entry mode. Is this possible? |
#3
|
|||
|
|||
opening forms base on data
Thanks for the info but I'm a novice at best. How do you create the events.
"Jeff Boyce" wrote: John Here's an alternate approach to consider ... You can use an unbound combobox in the header of your form to let the user pick the "customer". You can use that combobox's AfterUpdate event to load the form with the selected customer's data. You can use that combobox's NotInList event to see if the user wishes to add a new customer. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "john" wrote in message news i'm using a macro to open a form with information that equals the information in the form i'm in. Macro: Where Condition [VendorName]=[Forms]![frmInventoryOrder]![VendorName] This enables me to use the first form as a "look up" form. What I would like to do is if there is no matching data in the 2nd form that either: 1. msgbox would appear stating "customer does not exit would you like to add" OR 2. simply just open a blank form in the data entry mode. Is this possible? . |
#4
|
|||
|
|||
opening forms base on data
The events are already tied to the controls.
Open the form in design view. Highlight a control. Open the Properties window and look for the events. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "john" wrote in message news Thanks for the info but I'm a novice at best. How do you create the events. "Jeff Boyce" wrote: John Here's an alternate approach to consider ... You can use an unbound combobox in the header of your form to let the user pick the "customer". You can use that combobox's AfterUpdate event to load the form with the selected customer's data. You can use that combobox's NotInList event to see if the user wishes to add a new customer. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "john" wrote in message news i'm using a macro to open a form with information that equals the information in the form i'm in. Macro: Where Condition [VendorName]=[Forms]![frmInventoryOrder]![VendorName] This enables me to use the first form as a "look up" form. What I would like to do is if there is no matching data in the 2nd form that either: 1. msgbox would appear stating "customer does not exit would you like to add" OR 2. simply just open a blank form in the data entry mode. Is this possible? . |
#5
|
|||
|
|||
opening forms base on data
I can create the macro the open the form where the data matches. In Events
under "after updates" I enter the macro name. This works when the data matches but I'm not sure what to enter in the "Not on List" property. "Jeff Boyce" wrote: The events are already tied to the controls. Open the form in design view. Highlight a control. Open the Properties window and look for the events. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "john" wrote in message news Thanks for the info but I'm a novice at best. How do you create the events. "Jeff Boyce" wrote: John Here's an alternate approach to consider ... You can use an unbound combobox in the header of your form to let the user pick the "customer". You can use that combobox's AfterUpdate event to load the form with the selected customer's data. You can use that combobox's NotInList event to see if the user wishes to add a new customer. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "john" wrote in message news i'm using a macro to open a form with information that equals the information in the form i'm in. Macro: Where Condition [VendorName]=[Forms]![frmInventoryOrder]![VendorName] This enables me to use the first form as a "look up" form. What I would like to do is if there is no matching data in the 2nd form that either: 1. msgbox would appear stating "customer does not exit would you like to add" OR 2. simply just open a blank form in the data entry mode. Is this possible? . . |
#6
|
|||
|
|||
opening forms base on data
Open Access HELP NotInList and take a look at the examples.
Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "john" wrote in message ... I can create the macro the open the form where the data matches. In Events under "after updates" I enter the macro name. This works when the data matches but I'm not sure what to enter in the "Not on List" property. "Jeff Boyce" wrote: The events are already tied to the controls. Open the form in design view. Highlight a control. Open the Properties window and look for the events. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "john" wrote in message news Thanks for the info but I'm a novice at best. How do you create the events. "Jeff Boyce" wrote: John Here's an alternate approach to consider ... You can use an unbound combobox in the header of your form to let the user pick the "customer". You can use that combobox's AfterUpdate event to load the form with the selected customer's data. You can use that combobox's NotInList event to see if the user wishes to add a new customer. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "john" wrote in message news i'm using a macro to open a form with information that equals the information in the form i'm in. Macro: Where Condition [VendorName]=[Forms]![frmInventoryOrder]![VendorName] This enables me to use the first form as a "look up" form. What I would like to do is if there is no matching data in the 2nd form that either: 1. msgbox would appear stating "customer does not exit would you like to add" OR 2. simply just open a blank form in the data entry mode. Is this possible? . . |
#7
|
|||
|
|||
opening forms base on data
Normally I'd expect your second option to happen automatically. Check the
second form's AllowAdditions property. If its False (No) change it to True (Yes). That way you should find that if there is no matching vendor in the second form's underlying table or query the second form will open at a blank new record. The other possibility is that the second form's underlying recordset is not updatable (i.e. it’s a query which for some reason is not updatable), in which case it wouldn't allow you to enter a new record. If so you'd need to open a separate form based on an updatable recordset if there is no match, but you'd need to use code for this rather than a macro. Ken Sheridan Stafford, England john wrote: i'm using a macro to open a form with information that equals the information in the form i'm in. Macro: Where Condition [VendorName]=[Forms]![frmInventoryOrder]![VendorName] This enables me to use the first form as a "look up" form. What I would like to do is if there is no matching data in the 2nd form that either: 1. msgbox would appear stating "customer does not exit would you like to add" OR 2. simply just open a blank form in the data entry mode. Is this possible? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/201002/1 |
Thread Tools | |
Display Modes | |
|
|