473,507 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Load Subforms Dynamically?

Hello,
I have an Access 2000 ADP main form called frmAD_OpeningForm that
needs to support several possible sub forms.

The subform that should appear would be based on the combined bound
values of two combo boxes that are located in the form header of the
main form. The way I have the combo boxes set up in the main form is
to have the user make a selection in each combo box, then click a
button named ‘Set' (and labeled ‘Set') to make the correct subform
appear. These subforms would appear in the Detail section of the main
form.

When the form initially opens, there is a label in the detail section
(Label15) where the subform would go. This label text basically tells
the user to make a selection from both combo boxes, then click ‘Set'
to see a test. This label should not be visible when there is a
subform in the detail section.

I imagine the logic for what I am trying to do would go something like
this:

On Set_Click
Set frmAD_OpeningForm!Label15.Visible = No
IF (When)
[Forms]![frmAD_OpeningForm]![Combo2]='HMKRL6' And
[Forms]![frmAD_OpeningForm]![Combo4]='00'
THEN
SETVALUE: ITEM: [Forms]![frmAD_OpeningForm]![frmBogusSubForm].[SourceObject]
EXPRESSION: [frm0HMKRL6sub2]
ELSE
IF (Other Combo2 Combo4 Combination)
THEN
SETVALUE : ITEM: (Same subform Source Object (???))
EXREPSSSION: (the subform per the Combo2 and Combo4 combination)
ELSE (evaluate 100+ possible combinations of Combo2 and Combo4 and
show the appropriate subforms)

While the user is in the main form, if changes are made to either
combo2 or combo4, and the user clicks the ‘Set' button, the current
subform would need to be ‘removed' and the new one ‘loaded' if the
combination of the combo boxes would represent a different subform.

When the main form is closed, all subforms would need to be ‘unloaded'
and frmAD_OpeningForm!Label15.Visible = Yes.

I have tried similar logic in a macro to evaluate one possible
combination of Combo2 and Combo4 and assigned it to the On Click event
of the ‘Set' button, but when I tried it, I got the following
message:

The object doesn't contain the Automation object "frmOHMKRL6sub2".
You tired to run a Visual Basic procedure to set a property or method
for an object. However, the component doesn't make the property or
method available for Automation operations.
Check the component's documentation for information on the properties
and methods it makes available for Automation operations.

I think that this means that I can't perform a SET VALUE action on the
Source Object property of a subform. After I click okay on this
message, an ‘Action Failed' dialog box for the macro appears. The
macro does not run, and the frm0HMKRL6sub2 subform does not ‘load'
into the detail section of the main form.

What could I set up to make this work?

Thank you for your help!

CSDunn
Nov 12 '05 #1
0 1293

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2185
by: CSDunn | last post by:
Hello, I have an Access 2000 ADP main form called frmAD_OpeningForm that needs to support several possible sub forms. The subform that should appear would be based on the combined bound values...
1
2974
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various...
0
2225
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't...
1
5392
by: John Hunter | last post by:
I've recently had a nasty problem with the "Invalid reference to the property Form" error in subforms - nasty because it doesn't seem to consistently happen to all forms which contain the same...
12
1977
by: Paul T. RONG | last post by:
Is it possible to divide a tall subform with 80 records to two subforms each with 40 records? Dear All, What I have: Tables: tblProduct, tblOrder, tblOrderDetail
1
1022
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
2
1786
by: A.Wussow | last post by:
Hi Everybody, i want to load dynamically content from some user controls (with forms, or some data-controls) using atlas. So i use an UpdatePanel for loading the user control into a placeholder....
2
3958
by: Magenta | last post by:
What I'd like to do display a form that consists of subforms, and allow a user to resize the sections of a form at will. For example, if a form has three subforms, each placed vertically and...
3
4122
by: ApexData | last post by:
I'm starting a new project. A Personnel System. I have considered opening a single bound form to the main employee table. The user can scroll the records to any individual. I would like to have a...
3
2062
by: Rob | last post by:
I am putting together a small Access 2003 DB to record details of our motorvehicles. (this is more to teach myself some basics with Access) The main form is holding data that is common to most...
0
7111
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.