nicksource
Registered User.
- Local time
- Today, 18:31
- Joined
- Feb 18, 2008
- Messages
- 69
I have a form that shows what products go out of the store and to what person.
The form creates a row for each product to that one person in the table.
To group this data, I want to assign some sort of number that is inserted into each row, so I know that each of these products was sent out together. As each row for that person will have for example 1003 next to it... then the next group of products will all have 1004.
What I have done is created a table that stores a number, then a SQL query to get the last number... I was then thinking of just adding +1 to the end of this query (to get the next number)... but when I try to include the query into my form I get a #name? error, even thought it works fine without.
-----
My SQL Query:
GoodsOutNo table:
In my form field, I have this to ask for the query (but get the #name? error)
The form creates a row for each product to that one person in the table.
To group this data, I want to assign some sort of number that is inserted into each row, so I know that each of these products was sent out together. As each row for that person will have for example 1003 next to it... then the next group of products will all have 1004.
What I have done is created a table that stores a number, then a SQL query to get the last number... I was then thinking of just adding +1 to the end of this query (to get the next number)... but when I try to include the query into my form I get a #name? error, even thought it works fine without.
-----
My SQL Query:
Code:
SELECT TOP 1 GoodsOutNo.GoodsOutNo
FROM GoodsOutNo
ORDER BY GoodsOutNo.GoodsOutNo DESC;
So query says '1003'.ID | GoodsOutNo
1 | 1000
2 | 1001
3 | 1002
4 | 1003
In my form field, I have this to ask for the query (but get the #name? error)
Thanks in advance! Help will be very appreciated.[GoodsOutNoSelect]![GoodsOutNo]