Use the value of a parameter passed to a subroutine to update a re

  • Thread starter Thread starter David
  • Start date Start date
D

David

Hi,

This may be simple, but not sure how to do this in Access.

Used to do this in FoxPro years ago by putting an Ampersand in front of the
variable name, in order to have the value of the variable become the constant.

Here goes:

1. I am passing 3 variables to a routine I used over and over (thus, the
central subroutine): Form Name, Table Field Name, Form Field Name
2. I want to do this with the Table Field Name (strPathFile):
rst!strPathFile = strREPORTFolder; I am passing a value such as
"WklyTPRSave" to strPathFile.
3. I want to do this with the Form Name (txtForm) and Form Field Name
(strPathScreen): Form!txtForm.strPathScreen = strREPORTFolder.

Any ideas how to do this?
 
Hi,

The form/control reference worked like a charm.

What is the syntax for the record/field? (rst!strPathFile = strREPORTFolder)

Thanks.
 
David said:
This may be simple, but not sure how to do this in Access.

Used to do this in FoxPro years ago by putting an Ampersand in front of the
variable name, in order to have the value of the variable become the constant.

Here goes:

1. I am passing 3 variables to a routine I used over and over (thus, the
central subroutine): Form Name, Table Field Name, Form Field Name
2. I want to do this with the Table Field Name (strPathFile):
rst!strPathFile = strREPORTFolder; I am passing a value such as
"WklyTPRSave" to strPathFile.
3. I want to do this with the Form Name (txtForm) and Form Field Name
(strPathScreen): Form!txtForm.strPathScreen = strREPORTFolder.


Use the full collection reference syntax:

Forms(txtForm).Controls(strPathScreen) = strREPORTFolder
 
David said:
The form/control reference worked like a charm.

What is the syntax for the record/field? (rst!strPathFile = strREPORTFolder)


rst.Fields(strPathFile)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top