Save a record value as a variable to be used in a function 
Author Message
 Save a record value as a variable to be used in a function

Hi,

I am trying to save a record value (From a crosstab query, will always be an
integer, the field name is 'Total' and there is only ever one record) as a
variable to be used as a variable in a 'For Next' function.

I am new to Access VB coding and have spent the last few hours looking in
the help files for this! Is it possible? Can anyone share their wisdom?

Thanks in advance.

Neil



Sat, 19 Jul 2003 23:13:36 GMT  
 Save a record value as a variable to be used in a function
OK, scrub that! I have worked it out.

    Dim totalQuantityVar As Integer
    Dim ScanLoop As Integer
    Dim MyDB As DAO.Database, MyVAR As DAO.Recordset
    Set MyDB = CurrentDb()
    Set MyVAR = MyDB.OpenRecordset("VariablePickTableCrosstab")

    totalQuantityVar = MyVAR![Total]

Simple when you know how!

Neil


Quote:
> Hi,

> I am trying to save a record value (From a crosstab query, will always be
an
> integer, the field name is 'Total' and there is only ever one record) as a
> variable to be used as a variable in a 'For Next' function.

> I am new to Access VB coding and have spent the last few hours looking in
> the help files for this! Is it possible? Can anyone share their wisdom?

> Thanks in advance.

> Neil



Sun, 20 Jul 2003 18:18:13 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I am trying to update a record, i am not using data control

2. I am trying to update a record, i am not using data control

3. Update a record using a previous records value

4. Calling a sub or function using a variable through another sub or function

5. Help on saving object/variable names and values for later recall

6. Saving current record in recordset to a variable ???

7. Setting a variable to the largest record value.

8. Variable value changed by function but not intentionally

9. Function Name the value of a variable?

10. Passing a variable instead of a value to API-function

11. Aggregate function for values of fields in record

12. I am getting duplicate records, I mean everything is duplicate even Access record number

 

 
Powered by phpBB® Forum Software