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

Dimensioning and Using Controls

Status
Not open for further replies.

LarryDeLaruelle

Technical User
May 19, 2000
1,055
US
I have a couple of subforms in Continuous view with a comments field. The comments field display is small so I want to give the users a double click event that will open a simple edit form with a text field for editing. The user can then edit or add to existing comments and, On_Close, the contents of the text field are passed back to the calling form.

I have done this before using explicit references to the calling form and it works well. In that case, I have only one subform to deal with. In this case I have two subforms where I want to use this and, rather than create two separate edit forms, I want to pass the subform and field names to a common edit form and can't seem to get it to accept the passed value.

I give the full reference of the form/field name as an OpenArg of the DoCmd.OpenForm as:

"Forms!MainForm!SubForm.FieldName"

In the General Declarations of the edit form I Dim a ctl (I set it as a form level since I will use it in both the On_Open and On_Close events) and in the On_Open event I set it's value to the open args:

Set ctlCalling = OpenArgs

and I get the error message Object Required (Error 424).

MS Help says, among other things, that I did not provide a valid object qualifier or that I supplied an object qualifer but it isn't recognized as an object.

The first question, I guess, is: am I approaching this in the right way, that is, using a control? If not, what would be the correct way? Or, if this is the correct way to do the job, what is wrong with how I am trying to do it?

Appreciate any input you may have.

Thanks.
Larry De Laruelle
larry1de@yahoo.com

 
Here's something that popped into my head. There may be a more efficient way.

On the edit form that is going to pop open, creat a text box and set the Visible property to 'No'

Then depending upon which subform you do the double click event, you can send a value to the invisible text box (ie: 1 for subform1 and 2 for subform 2).

Now after the user is finished editing information and closes this popup form, you can tell it which subform to send the data to based on the number in the invisible text box.

Just a thought. ljprodev@yahoo.com
Professional Development
MS Access Applications
 
Thanks Lonnie.

That will be a good work-around if I can't get the syntax correct on assigning a value to a control.

I'm trying to make this a generic edit form that can be used from any form/subform in my project.

I work at a residential treatment center and this is a database to be used by our nursing staff. They need to track information relevant to medications, injuries, infections, etc. Because of the nature of what we do, documentation is a major CYA factor and comment/memo fields are used extensively for that purpose.

I anticipate that I will probably want to use this pop up edit form at least half a dozen times. The more generic I can make it the better.

Thanks again.
Larry De Laruelle
larry1de@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top