Hello,
I have a form (frmMain) with two sub forms (SubA and subB). When frmMain loads the textboxes within SubA are populated from a query that returns values from a local table based on whether a certain ID exists in the table. My problem is that if the ID does not exist the query returns no records and consequently the sub form (SubA) is greyed out and is not enabled, or so it seems. However, if the query and in turn SubA returns no records, I'd like the end user to be able to add a new record through form SubA. I've tried writing code for a button so that the button can allow the user to GoTo new record but it did'nt work. My question is:
How can I design SubA either in its onload event or in the onload event of frmMain so that when the query returns no IDs the user is taken to a new blank record so he/she can enter a new ID ?
Cheers,
Al
I have a form (frmMain) with two sub forms (SubA and subB). When frmMain loads the textboxes within SubA are populated from a query that returns values from a local table based on whether a certain ID exists in the table. My problem is that if the ID does not exist the query returns no records and consequently the sub form (SubA) is greyed out and is not enabled, or so it seems. However, if the query and in turn SubA returns no records, I'd like the end user to be able to add a new record through form SubA. I've tried writing code for a button so that the button can allow the user to GoTo new record but it did'nt work. My question is:
How can I design SubA either in its onload event or in the onload event of frmMain so that when the query returns no IDs the user is taken to a new blank record so he/she can enter a new ID ?
Cheers,
Al