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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Errors connect to OLE

Status
Not open for further replies.

d1004

Programmer
May 9, 2002
78
0
0
US
I created a subform and w/in my subform is a frame with 4 radio options (Apple, Orange, Grape, Banana). The purpose of this frame is when the user select a certain fruit, it populates the shopper ID and the current date into the field. And I use the following code:

Private Sub fraResultOpt_Click()
userID = Environ("username")
DateTested = Date
End Sub

But when I test it, it gave me the following error message:

A problem occurred while MSAccess was communicating with the OLE server or ActiveX Control.
* The expression may not result in the name of a macro, the anme of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function, event, or macro.


I even double check the name to see if it is spelled correctly, and it is. So I'm not sure why I'm getting this error. Please help.
-thank you.
 
I assume the error is happening on the userID=... line?
It should work, but be aware that the username environment variable is not set on Win9X - it should return an empty string if not set.

Can you investigate further to isolate exactly where the error is occurring - is it the Environ() call, or the userID= assignment? Try a hard-coded string instead of Environ() e.g. userID = "Norris68"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top