473,386 Members | 1,773 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,386 software developers and data experts.

Dynamically Creating a form

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
4 1566
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the...
2
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
2
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is...
5
by: Mike Dee | last post by:
Is it possible to dynamically create a new form object (form1), then create a new form field object and add it form1, and then add form1 to the current document? I need to do all this in script...
9
by: netasp | last post by:
hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related...
0
by: lianaent | last post by:
Hi All, I'm brand new to asp.net 2.0, and have a simple task of just creating a quick and dirty data entry form with SQL Server 2005 on the back end. I added a gridview to my form, and I can...
4
by: mohaaron | last post by:
I can think of a lot of reasons why this might need to be done but as far as I can tell it's not possible. I've been looking for a way to add HtmlTableRows to a table using a button click for a...
8
by: BillE | last post by:
When I create a control dynamically and it grows according to the content, the control Height property still returns the original default control height instead of the height after expanding. ...
7
by: Malakie | last post by:
Hi all, I am trying to self teach VB .net to myself. Not sure what is worse, trying to accomplish this or thinking I can actually do it! ;-) Anyhow, Would someone be able to give me some...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...

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.