Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Something in Place of Me!

Status
Not open for further replies.

littleman

Technical User
Nov 13, 2001
5
EU
I'm having problems running the following within a module in that Access will not recognize the Me! aspect of the code:

'If Me!AgentSeconda = " " Then
' Fdf_Output.FDFSetValue "GA1", " ", False
'Else
' Fdf_Output.FDFSetValue "GA1", "1746", False
'End If

What I want this function to do is that if the AgentSeconda field is blank I want the FDFValue of GA1 to be blank as well...if AgentSeconda is not blank then I want the FDFValue of GA1 to fill in with 1746...

Any ideas on what I can use instead of Me! or does anyone have another way of writing this function?

Thanks,
Ryan.
 
Me! refers to the form where the code resides. If the code is in a module instead then you have to refer explicitly to the form:

Forms!MyForm instead.

Uncle Jack
 
There are several possibilies depending on your code.
1. You can pass the form as a parameter:

public sub YourSub(f as form)

dim strValue
strValue=f!FieldName

2. You can use Screen.activeform

public sub YourSub()
dim f as form
set f=screen.activeform
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top