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
|
|||
|
|||
Find a record in a table, based on a criteria, and use it in another form
Hi All,
I have a form that needs to find the next available order number (located in table OrderNumber) and use it in the form when adding a new order. I need to know the following please; -how to open the table from the form - find the last unassigned order number (field = ordernumber and criteria is Lastused = 0) - use the ordernumber found in the form. Any help really would be appreciated. Thanks!!! Justin |
#2
|
|||
|
|||
Find a record in a table, based on a criteria, and use it in anoth
Assuming that the ordernumber is a number and not text, check out the DMin or
maybe DMin functions. Do not be tempted by the DLast or DFirst functions. The lead to the dark side.... -- Jerry Whittle Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Justin" wrote: Hi All, I have a form that needs to find the next available order number (located in table OrderNumber) and use it in the form when adding a new order. I need to know the following please; -how to open the table from the form - find the last unassigned order number (field = ordernumber and criteria is Lastused = 0) - use the ordernumber found in the form. Any help really would be appreciated. Thanks!!! Justin |
#3
|
|||
|
|||
Find a record in a table, based on a criteria, and use it inanother form
Justin,
You could possibly use the Default Value property of the OrderNumber control on your form for this. Just set it to... DMax("[OrderNumber]","YourTable")+1 But I am not sure about this, as I don't understand your reference to "Lastused=0". Maybe it would clarify if you could give an example. -- Steve Schapel, Microsoft Access MVP Justin wrote: Hi All, I have a form that needs to find the next available order number (located in table OrderNumber) and use it in the form when adding a new order. I need to know the following please; -how to open the table from the form - find the last unassigned order number (field = ordernumber and criteria is Lastused = 0) - use the ordernumber found in the form. Any help really would be appreciated. Thanks!!! Justin |
Thread Tools | |
Display Modes | |
|
|