473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 2165

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

Similar topics

0
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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
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,...
0
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...

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.