Passing fieldname to a subroutine



I have a form with a subform. In the subform I have several fields to
which I am assigning links to documents on the file server. I learned
(from this list :-) how to add the links. Because I will be executing
the code for four or five fields, I would like to have a generic
subroutine to pass the field name parameters to. I have searched and
tried many formats and syntaxes for this with no success.

Here are the principle lines from the routine that I wish to make more
general

lnkApplication = varFile & "#" & varFile ' puts the hyperlink in the
field.

lnkApplication.Visible = Not (IsNull(lnkApplication.Value)) ' only
shows the field on the form if it has a path in it

lnkApplication is the actual name of the field in a table called
tblFamilyMembers.

Please help me with the syntax to pass the fieldnames to a general
subroutine and to modify the lines above. Also, please let me know if
there are any additional lines of code needed to make it work.

Thanks,
Bernie

.



Relevant Pages

  • goto next record in a datasheet
    ... I am trying to create a subroutine that will loop through a recordset of ... items and add them to a new record in a subform in datasheet mode. ...
    (microsoft.public.access.formscoding)
  • Where to start?
    ... I am unfamiliar with programming in VBA. ... However I have the need to create a subroutine that takes information from a ... subform, compares the data with data held in a table and prints ...
    (microsoft.public.access.modulesdaovba)
  • Re: executing a subforms subroutine from the main form
    ... David Gartrell wrote: ... Attached to the subform I have a subroutine I've written called 'Totals'. ... this then i'd be very grateful. ...
    (microsoft.public.access.forms)
  • calling a mainform subroutine from a subform
    ... I want to call that routine from the doubleclick event of a control ... I can't figure out the syntax to call that subroutine from the subform. ... Private Sub weldletter_DblClick ...
    (microsoft.public.access.forms)