I have two recordsets which represent tables - rsmaster and rsship.
the recordset rsship refers to a table (tblship) which may or may not contain a ship to address for a customer that is different from the ship to address in rsmaster. If there is a record present in tblship, I want to transfer the field amounts to form variables. Otherwise I want to get the variables from rsmaster.
I am doing a select and recordcount on rsship to determine if a ship to address is present. I would like to avoid duplicating code by doing something like this:
if rsship.recordcount = 0 then
with rsmaser
else
with rsship
end if
me.txtshiptoname = .sname
.
.
end with
but that, of course, generates an error message. Does anyone know how I could substitute a variable for the recordset and do something like
if rsship.recordcount = 0 then
var = "rsmaster"
else
var = "rsship"
endif
with var
.
.
end with
Thanks.
the recordset rsship refers to a table (tblship) which may or may not contain a ship to address for a customer that is different from the ship to address in rsmaster. If there is a record present in tblship, I want to transfer the field amounts to form variables. Otherwise I want to get the variables from rsmaster.
I am doing a select and recordcount on rsship to determine if a ship to address is present. I would like to avoid duplicating code by doing something like this:
if rsship.recordcount = 0 then
with rsmaser
else
with rsship
end if
me.txtshiptoname = .sname
.
.
end with
but that, of course, generates an error message. Does anyone know how I could substitute a variable for the recordset and do something like
if rsship.recordcount = 0 then
var = "rsmaster"
else
var = "rsship"
endif
with var
.
.
end with
Thanks.