
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