This should not be this hard..

pullmyefinger

Registered User.
Local time
Today, 18:56
Joined
Feb 26, 2011
Messages
37
I am new to this stuff so pls do your explanation accordingly.

I have an access table called SEQ with fields such as SeqA, SeqB...Seq?, etc.

These are Integer fields that store one sequence number for a particular location (A,B,C...).

I have an optiongroup that asks for the particular location (A,B,C), then I create a concatenated variable to store the Actual Field Name in a Variable, e.g.:

this is pseudocode only

dim loctext, seqvar as string

seqvar="Seq"

fldname=seqvar & loctext ( if loctext="BI" then fldname="SeqBI". THIS WORKS).

I did the ADODB connection crap and that seems to be ok syntax-wise. no errors there.

The PITA part is that after going to The ONLY Record in the SEQ table and

getting the VALUE for the field name SeqBI.


How the heck do I get VB to get the INTERPRET "fldname" as an Actual Field from the SEQ table AND give me the VALUE of the field in the current record?????????????

I read post after post from Dave somebody and Gemma the Dog or something like that, TRIED all of it and none of it worked.

I keep getting run time errors cuz VB can't interpret what I want cuz I don't know how to say it right.

----------Summary---------------------------

let's say that in table SEQ there is a field name called SeqBI (there is), and it's current value in the current (and only) record is 68.


currvalu = SEQ.Fields(fldname).Value (currvalu is Integer)

(this is what needs to work regardless of the field name in the SEQ Table)

then

newvalu = currvalu + 1

("newvalu" is the next sequence number, auto generated via this code)

I Also need to be able to "assign" a piece of equipment that value (SEQBI needs to be 69 for a piece of equipment in Another Table on the form),

After that sequence number is assigned to the equipment, the Value 69 needs to be Written back in the SeqBI field of the current/only record in the SEQ table.

This process will obviously repeat for any piece of equipment at any location.

Hopefully I can get an answer that works!! Thank You
 
I’m not 100% sure but I get the impression that you are trying to duplicate functionality you would find in an excel spreadsheet. When you say you want to find the field name, and then write to a particular row in that field, that’s sort of what you would do in excel.
 
your question is vague. But if I think i understand what you want to do; that is increase the value of a sequence number for a location then i created a small demo that does that; it will give you a little bit to work with.
 

Attachments

I’m not 100% sure but I get the impression that you are trying to duplicate functionality you would find in an excel spreadsheet. When you say you want to find the field name, and then write to a particular row in that field, that’s sort of what you would do in excel.

Thank you, but that is not even remotely close. I am stuck with Microshaft Access cuz I don't want to spend the money for R:BASE 7.5.

I could have this problem solved in the 1985 Version of R:BASE System V in 2 statements.
 
Thank you, but that is not even remotely close. I am stuck with Microshaft Access cuz I don't want to spend the money for R:BASE 7.5.

I could have this problem solved in the 1985 Version of R:BASE System V in 2 statements.
If you want an answer you should make your question more specific. Without seeing your database I cannot be sure but your initial question suggests your data is not normalized.
 

Users who are viewing this thread

Back
Top Bottom