pullmyefinger
Registered User.
- Local time
- Today, 11:15
- Joined
- Feb 26, 2011
- Messages
- 37
Need help to get past this pothole in my app.
I have a 1-Record Table called SEQ (sequence number table).
There are 8 fields corresponding to 8 different locations and are named as SEQBI, SEQLH, SEQPL, etc.
-------------------------------
The thing about this is since there are 8 locations I cannot and will not hard code this for every location. The reason is that the locations are stored in an Optiongroup and I have to let them pick any location they want at any time.
The person entering the data should be able to pick any location to add equipment to, get the Next Sequence number for that location and Add that piece of equipment to the Location table with the Unique Sequence Number.
The end result would be a report by location of all items in that location amongst other things.
"If SEQPL has already used sequence numbers 1,2 and 3, then #1 might be a router, #2 might be a Sawzall, #3 could be a cd player. The current value in the SEQPL field would be 3, and when the next item gets added to the PL location, the app would:
1. open a connection to the database/tables/fields/values etc..
2. after the user picks the right location (this part works) via an option group, a variable is created containing the name of the correct field in the SEQ Table as:
Dim Seqvar="SEQ"
If the var loctext="BI" from the options group, Then the concatenated
variable fldname (fldname=seqvar & loctext) would, and does have the value "SEQBI".
"SEQBI" is a field in the SEQ table and will need to be accessed for its current value (sequence number),
THEN store that value to a Variable (THIS IS WHAT I DON'T KNOW HOW TO DO - KEEP GETTING R/T ERROR 424 SAYING MY EXPRESSION IS NOT A VALID OBJECT. I AM GUESSING THAT IT IS COMPLAINING ABOUT HOW I DEFINED THE SEQBI FIELD IN THE SEQ TABLE OF THE 1 AND ONLY RECORD)
THEN, ONCE THAT WORKS, I INCREMENT THE CREATED VARIABLE BY 1 FOR THE NEXT SEQUENCE NUMBER (X=Y+1)
THEN WRITE THE X VARIABLE'S VALUE BACK TO THE SEQBI FIELD IN THE SEQ TABLE. THIS WOULD MEAN THAT THERE ARE NOW 4 ITEMS AT LOCATION "BI" ONCE THE OTHER LOCATION TABLE IS FILLED IN WITH THE NECESSARY INFO.
---------------------------------
IN SUMMARY, HOW DO I:
TAKE A TABLE CALLED SEQ WITH A FIELD CALLED SEQ?? (WHATEVER), STORE ITS CURRENT VALUE IN A VARIABLE "Y", INCREMENT THAT VALUE BY 1 TO VARIABLE "x" AS X=Y+1, THEN WRITE THE VALUE OF THE VARIABLE X BACK TO THE SEQ?? FIELD??????
THIS PROCESS WOULD REPEAT FOR ANY LOCATION/CORRESPONDING FIELD IN THE SEQ TABLE AND ANY NUMBER OF ITEMS.
-----------------------------------------------------
Now I know what a 10-year old feels like being blindfolded and trying to hit a swinging pinata..
Each field above will store a sequence number that corresponds to the next number to be used for tracking items.
As an example, let's say the SEQPL field currently has a value of 0, meaning there is no equipment at that location yet.
I have a 1-Record Table called SEQ (sequence number table).
There are 8 fields corresponding to 8 different locations and are named as SEQBI, SEQLH, SEQPL, etc.
-------------------------------
The thing about this is since there are 8 locations I cannot and will not hard code this for every location. The reason is that the locations are stored in an Optiongroup and I have to let them pick any location they want at any time.
The person entering the data should be able to pick any location to add equipment to, get the Next Sequence number for that location and Add that piece of equipment to the Location table with the Unique Sequence Number.
The end result would be a report by location of all items in that location amongst other things.
"If SEQPL has already used sequence numbers 1,2 and 3, then #1 might be a router, #2 might be a Sawzall, #3 could be a cd player. The current value in the SEQPL field would be 3, and when the next item gets added to the PL location, the app would:
1. open a connection to the database/tables/fields/values etc..
2. after the user picks the right location (this part works) via an option group, a variable is created containing the name of the correct field in the SEQ Table as:
Dim Seqvar="SEQ"
If the var loctext="BI" from the options group, Then the concatenated
variable fldname (fldname=seqvar & loctext) would, and does have the value "SEQBI".
"SEQBI" is a field in the SEQ table and will need to be accessed for its current value (sequence number),
THEN store that value to a Variable (THIS IS WHAT I DON'T KNOW HOW TO DO - KEEP GETTING R/T ERROR 424 SAYING MY EXPRESSION IS NOT A VALID OBJECT. I AM GUESSING THAT IT IS COMPLAINING ABOUT HOW I DEFINED THE SEQBI FIELD IN THE SEQ TABLE OF THE 1 AND ONLY RECORD)
THEN, ONCE THAT WORKS, I INCREMENT THE CREATED VARIABLE BY 1 FOR THE NEXT SEQUENCE NUMBER (X=Y+1)
THEN WRITE THE X VARIABLE'S VALUE BACK TO THE SEQBI FIELD IN THE SEQ TABLE. THIS WOULD MEAN THAT THERE ARE NOW 4 ITEMS AT LOCATION "BI" ONCE THE OTHER LOCATION TABLE IS FILLED IN WITH THE NECESSARY INFO.
---------------------------------
IN SUMMARY, HOW DO I:
TAKE A TABLE CALLED SEQ WITH A FIELD CALLED SEQ?? (WHATEVER), STORE ITS CURRENT VALUE IN A VARIABLE "Y", INCREMENT THAT VALUE BY 1 TO VARIABLE "x" AS X=Y+1, THEN WRITE THE VALUE OF THE VARIABLE X BACK TO THE SEQ?? FIELD??????
THIS PROCESS WOULD REPEAT FOR ANY LOCATION/CORRESPONDING FIELD IN THE SEQ TABLE AND ANY NUMBER OF ITEMS.
-----------------------------------------------------
Now I know what a 10-year old feels like being blindfolded and trying to hit a swinging pinata..
Each field above will store a sequence number that corresponds to the next number to be used for tracking items.
As an example, let's say the SEQPL field currently has a value of 0, meaning there is no equipment at that location yet.