table questions

pullmyefinger

Registered User.
Local time
Yesterday, 19:40
Joined
Feb 26, 2011
Messages
37
1. is a recordset nothing more than a table?

2. if i have a field called fldA in table tblA, can I/How do I store the value of that field in a VARiable???

3. within a vb event procedure, can i close one table and immediately open another? how?

4. can i have more than one table open and Active simultaneously? how?
 
1. is a recordset nothing more than a table?

...

A recordset is a collection of records either a complete table or a set of records returned by a query, this article contains some further information on the topic.

...

2. if i have a field called fldA in table tblA, can I/How do I store the value of that field in a VARiable???

...

Have a look at the various available Domain Aggregation function that are available. DLookup() is probably the one you are looking for here

...

3. within a vb event procedure, can i close one table and immediately open another? how?

...
Tables are not opened or closed in VBA event procedures however you might open or close DAO or ADO recordsets in VBA, the link in my first answer will give you more information on the subject.
...

4. can i have more than one table open and Active simultaneously? how?
See my previous answer.
 
Thanks John, but I did not explain this very well cuz I still don't know much about Access.

I am using ADO and won't use DAO regardless.

This is what I want to do and the way I want to do it. If there is a better way, it can wait till I understand more.

1. Create a form with text boxes representing variables. These vars are dim'd in the form load event, such as

Dim tlocation as String, tseq as Integer

2. Put info in the textboxes, then store them to the variables:

tlocation=forms!text111.txt.value

3. Prompt for the info being correct, then use *.AddNew to add a blank dbf record.

4. Maybe I read that the AddNew Method does (3.) with the right parms, or I will do it here.

5. Do an **.Update to write the record to the table.

Can these be done the way I want to do them??
 
I am using ADO and won't use DAO regardless.
Just so you know that is like saying I drive a Cadillac but will only use parts made by Ford.
This is what I want to do and the way I want to do it. If there is a better way, it can wait till I understand more.

1. Create a form with text boxes representing variables. These vars are dim'd in the form load event, such as

Dim tlocation as String, tseq as Integer

2. Put info in the textboxes, then store them to the variables:

tlocation=forms!text111.txt.value

3. Prompt for the info being correct, then use *.AddNew to add a blank dbf record.

4. Maybe I read that the AddNew Method does (3.) with the right parms, or I will do it here.

5. Do an **.Update to write the record to the table.

Can these be done the way I want to do them??
[/quote]
You can do that but the BETTER way is to let Access do the work for you by binding the form to the table. I'm curious as to why you want to go through all of the work putting something together that can be done for you almost "out of the box."
 
Bob, thanks for the reply.

The reason I am doing it this way is right now it doesn't have to be pretty, it just has to work.

For future reference, are you telling me that I can go into the properties of a text box like "text92", choose Properties, Control Source and put the "bind" there??

HOW do I do that??

Text92-116 are textboxes on form "Add".

The info from each textbox needs to be written to a new, blank record in the EQPT Table After all the textboxes are filled and checked for accuracy).

I can now see that it would be quicker to bind the textbox to a field in a record of a table, so if you would show me how to do that it would help out alot.

I will try the out of the box way if it will let me 1) correct typos in place and/or by doing a back tab, 2)let me ask the user if the data are correct/ commit changes? via a msgbox and 3) then add a blank record and write the textbox values to the appropriate fields.

The people that are doing the data entry don't know much at all about doing data entry. I am not helping out much by this being the first app that i have to write values to a table(s).

Thank You

PS: the article link was like me having a caddy, using ford parts that came with Metric dimensions and I only have SAE tools.
 
Last edited:
For future reference, are you telling me that I can go into the properties of a text box like "text92", choose Properties, Control Source and put the "bind" there??

Yes, I am.
HOW do I do that??
You go to the form in design view and find the record source property and you can select a table or query from the drop down list or you can put a SQL Statement in. It needs to be an updatable query if you want to add/edit records. Then you go to each text box and select in its CONTROL SOURCE property the field you want it bound to from the drop down list.

The info from each textbox needs to be written to a new, blank record in the EQPT Table After all the textboxes are filled and checked for accuracy).
You then start with the form on a new record and the person fills in the information. In the form's BEFORE UPDATE event you can validate everything to ensure all is filled out to your satisfaction before committing the record. If the validation fails you can send it back to the user by using

Cancel = True

in the code. You can use

Me.Undo

to undo the entire form in order to cancel the record completely, if you wish or you can ask them if they wish to abandon it and do the Me.Undo if they say yes. If they want to continue with the record all you need is the Cancel = True and it will then let them edit it further and then a save can be attempted again. A save can happen when moving to another record or a new record or by initiating it yourself by perhaps a SAVE button you put on the form. All it has to do is to try to save by using

If Me.Dirty Then Me.Dirty = False

and then that will fire the Before Update event (as does moving to a new record if the form is "dirty" (meaning it has changes or additions in the form fields for that record).


PS: the article link was like me having a caddy, using ford parts that came with Metric dimensions and I only have SAE tools.

What article link? I don't see any article link in this thread. The only link I see in this thread is the one for my website in my signature (which appears with every post I make).
 
...

What article link? I don't see any article link in this thread. The only link I see in this thread is the one for my website in my signature (which appears with every post I make).

Bob I suspect he is referring to the link, I made in my response, to Allen Browne's web site.
 
Bob I suspect he is referring to the link, I made in my response, to Allen Browne's web site.

Ah, I missed those when I scanned back over the posts trying to figure it out. I really must need new glasses. I gotta get in and get them.
 

Users who are viewing this thread

Back
Top Bottom