A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Find a record in a table, based on a criteria, and use it in another form



 
 
Thread Tools Display Modes
  #1  
Old February 3rd, 2006, 03:23 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default 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  
Old February 3rd, 2006, 04:10 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default 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  
Old February 4th, 2006, 06:51 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.