?
Solved

Using Forms 2.0 Frame Control on MS Access Form

Posted on 2009-05-19
2
Medium Priority
?
1,845 Views
Last Modified: 2013-12-26
Please provide a VBA example of how to access and set the value of a textbox placed on an MS Forms 2.0 Frame Control within an MS Access form.

In Excel the following code displays the value of textbox1:

MsgBox Frame1.Controls("textbox1").Text

On an Access form, this does not work  

In addition:

Frame1.Controls.Count = 0

 
0
Comment
Question by:jakemdrew
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 24428054
You generally must reference the Object property of the control. Many find it easier to set the control to a variable, so you can use Intellisense:

Dim ctl As forms.Frame
Set ctl = Me.YourFrameControl.Object

ctl.Controls("textbox1")

I'm not sure about the "forms.frame" ... I don't use the 2.0 controls due to the instability they seem to always produce, but I'm sure you can locate the correct library.

Note you do NOT reference the .Text property of Access textboxes unless those controls have the focus. This is unlike VB, where you must reference the .Text properly.
0
 
LVL 3

Author Comment

by:jakemdrew
ID: 24428116
This worked!  Thank you!

Dim x As MSForms.Frame

Set x = Me.Frame4.Object

MsgBox x.Controls("textbox1").Value
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question