By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,829 Members | 670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,829 IT Pros & Developers. It's quick & easy.

Dynamically Creating a form

P: n/a
How does one create/change a form on the fly?

I have a situation where I would like the user to be able to determine
the fields they view and how the data is grouped at runtime.

For example, the form might list Company Name, Last Name, Address,
Phone Number, Accounts Payable $ on time and Last Name, Address, Phone
Number, Social Security, Accounts Payable $ the next and Company Name
and Accounts Payable $ the time after that. Each one of course would
provide different totals with respect to accounts payable?

I've tried to list all of the possible fields on the form, change the
record source data to get the proper grouping and then simply "hide"
the fields I don't need but this doesn't work in datasheet view. I
can't hide (ie. affect the visible property) the fields and simply get
an error in the field because the new recordsource does not contain
the unwanted field.

Thanks.
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
What you can do, is simply place the common fields (text box controls) on
the form.

Then, have several "extra" text boxes that are UN-BOUND. You can simply set
the CONTROL SOURCE of each text box to the field you want it to edit.

me.txtContorl1.ContorlSouce = "Company"

The above would thus make the text box contorl1 edit the company field. You
can do this setup of code in the forms on-load event.

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 13 '05 #2

P: n/a
Thanks Albert, unfortunately, this doesn't work. The form is in
datasheet view and while I can control the content by doing this, the
"empty" columns still appear on the forms, regardless of the visible
property.

Regards.

"Albert D. Kallal" <Pl*******************@msn.com> wrote in message news:<0F8Vc.153170$J06.58467@pd7tw2no>...
What you can do, is simply place the common fields (text box controls) on
the form.

Then, have several "extra" text boxes that are UN-BOUND. You can simply set
the CONTROL SOURCE of each text box to the field you want it to edit.

me.txtContorl1.ContorlSouce = "Company"

The above would thus make the text box contorl1 edit the company field. You
can do this setup of code in the forms on-load event.

Nov 13 '05 #3

P: n/a
Use a continues form...and not datasheet view....users will likely never
know the difference...
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 13 '05 #4

P: n/a
Thanks,

Works like a charm.

Jim.
"Albert D. Kallal" <Pl*******************@msn.com> wrote in message news:<RfbWc.180182$M95.30766@pd7tw1no>...
Use a continues form...and not datasheet view....users will likely never
know the difference...

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.