accessing feilds in a table

jwlnewsome

Registered User.
Local time
Today, 22:39
Joined
Jan 10, 2006
Messages
20
Ill start from the dawn of time

right all tables are like a 2d array so does any body know how i can access a field in a row of a table ie like in most languages it goes a bit like this ArrayName(1,1) with ArrayName being the name of the table and that access the first field of the first row. im new to Vba and access 2000 but all i want to do is access the fields in a column of a sub-form displayed as a table add them all up and place the answer in a text box on the main form stick all this in a function so i can run it inside a macro

q1 is this possable
q2 how do you do it

thanks in advance john
 
You can probably do what you need with DAO or ADO...

a. Search here for more info...
b. Google it (them)...
c. Get a good book...
 
hello ken

got any good sites for the sort of info i need

thanks in advance john
 
Q1 Yes it is
Q2 Dunno

Reason I dunno is, you are thinking in terms of VB/VBA and what you really want to do is look at a recordset of data.

As you know programming, look at the help for SQL within Access.
This will give you a better understanding of how the data is presented.

Please post back with questions.

Cheers,
 
If you are talking about summing the columns in a single row, you have a design problem. If you are talking about summing the rows of a column, it is quite simple.
1. Add a footer to the subform. It isn't necessary for it to be visible on the main form.
2. Add a control to the subform. Change its Name property to something meaningful such as SumMyAmount.
3. Make its ControlSource -
=Sum(MyAmount)
4. Add a control to the mainform.
5. Make the mainform control's ControlSource -
=[subformcontrolname]!SumMyAmount

The mainform field will automatically update whenever the subform record is saved.
 

Users who are viewing this thread

Back
Top Bottom