Hello I am trying to create a Form in Access 2010 with dynamic controls.
On the form there is a list of textboxes for entering information.
However I would like the ability to click a button to dynamically add more textboxes to the form on request. (This is because I am not confident with a set number of text boxes as the information entered at one time could vary)
The problem is that digging around it seems the only way to add controls to a form is to open the form in design mode and add the controls, and when design mode is closed the user is prompted with a dialog asking them to save the changes made in design mode before the form can be reopened in normal mode.
Is there any way to solve this problem or would a workaround be needed (like a large number of hidden textboxes already present in the form? )
"...like a large number of hidden textboxes already present in the form..." -- I don't consider that a work-around. It's your best solution.
It does require the form to be opened for design, but VBA does facilitate these in-use changes.
Your question sounds strange...Controls for what ? Do you also plan to add fields to your db on the fly ? I hope not because then you have a serious design problem.
Otherwise, with the few details you provide, I would think the way to go is very simple: use a "continuous" subform like explained here.
Related
I have a home form that automatically opens up to provide the user of my Access database navigation and a few other services, however, a lot of what the home form does, is heavily reliant on VBA, so unless the user has accepted the security warning, things will break.
To work around this, I have hidden everything on the form except for a label telling the user that they need to enable Macros in the Security Panel. Once the user does this, the form is obviously re-loaded, and VBA code will run on_load, showing all the buttons, and hiding the label.
However, occasionally I will open up the database, and all the buttons will be visible, and the warning label hidden, before I check the security warning. If I open them up in design view, the visibility property of each object is opposite of what I originally set it as, and I have to go reset it. I haven't been able to reproduce this error on command, but it happens reasonably regularly, without any kind of pattern that I have noticed. There are a few other forms which also have changes in their layout, and it occasionally happens to them as well.
I'm wondering if this is a problem anyone else has faced, and if so, what may have caused it.
This can be caused by:
Opening the database
Enabling macros
Switching your home form to Layout View
Making any kind of design change
Closing the form and saving changes
The change of visibility from your VBA is locked in when you save changes from Layout View.
Could this be what is happening?
I want to create 'Navigation Forms' in 'ms Access' as it should look like a form but i need to navigate in between them.
And the forms are composed of queries creation of form is simple but the problem is like if i can create in 2010 or 2013 its just simple but i dont have upgraded version but i think there is some way to create page navigation like 2010 and 2013 in 2007.
Any help is accepted.
Here is a sample link in 2010(https://www.youtube.com/watch?v=ovcxmeyrILQ)
Tab Controls are NOT the same as Navigation Controls! Tabs Ctrls hold separate forms on each page or tab, which means when the main form loads it loads ALL the sub-forms that are contained on the various pages of the TabCtrl.
Sadly Nav Ctrls were introduced in A2010, however, I've been using them since 2003. Well obviously not exactly because they were introduced. But instead I used labels (not command buttons although you can use those - I chose labels because I wanted to change the background and font color of the selected "tab"). I also wrote a function that took the value of the label (aka subform name) and used that to change the form of a subform control which was placed directly below or beside the labels depending on whether I wanted a horizontal or vertical "nav ctrl".
I could upload the code for this, however, I believe, given that MS has given a better control than this work around AND you should be able to piece this together if you've got a basic working experience with VBA.
I'm creating a simple form using Chronoforms, but so far I haven't been able to solve a small problem.
I would love to load two or three fields in a search done by the autocomplete element, i currently have two autocompletes working, but i can't seem to be able to load the other values into the corresponding textboxes.
I'm including the link to the form
http://cfobb.ca/index.php?option=com_chronoforms&chronoform=nomination_form
and as it can be seen, the first two fields in the first tab are working autocompletes, but i would love to have them linked so when the user chooses in any of the two, the other automatically gets filled. That selection would also trigger another sql query (that i already have, nothing fancy) that would fill the School Name drop-down menu. Also there's this code in the help tab
$form->data['_PLUGINS_']['autocomplete_processor']['result'];
but i don't really know how to use/handle it
Thanks
I've got a master form on my page, and I want to create onClick events for some of my drop down boxes to populate other drop down boxes depending on the choice made.
I know I can't have a form within a form.
Any advice on how I can achieve this.
I'm using HTML, Classic ASP and Mysql to populate the combo boxes.
Thanks
John
John. To do this, you would need an AJAX engine running alongside your Javascript, unless you want your page to reload everytime you want the combos to be populated.
There are many ways to do this and each easier than the latter, but all of them will require an ASP file doing the response in a XML file.
Start with the basics: Learn about Javascript & Ajax... or cut half of your work/time and learn jQuery's. Trust me,... it's worth the trouble.
http://api.jquery.com/jQuery.ajax/
Does microsft office access have this function when i select the row from the subform,
the selected data from EmpName, ComputerName & ProductName will automatically fill into my 2 textbox at the top right and the product Name will be another combobox to select product.
Another thing is, Is it possible to do CRUD upon selection in subform?
what kind of tag should i goggle for to answer my question? I tried a lot of different tags aldy but none answers my question.
The short answer is yes. ;) You can do all those things. I well remember the day I realized that I could do anything in MS Access. (now be kind this was the first experience I had in programming)
You can reference Parent controls from subforms with this convention Me.Parent.control
For example if the Parent form has a text box named txtEmployeeId then on the Click event of a text box in the sub form you could have this code.
Me.Parent.txtEmployeeID = Me.txtEmployeeID
You can quickly extend this code to do whatever you need ie.
Me.Parent.txtComputerName = Me.ComputerName
Me.Parent.cboProductName = Me.ProductName
CRUD is a statement used in web development which seems to be where you are coming from. Access is CRUD in many ways (unless you start getting complicated) In the example above, once you navigate off the parent record with the record selector or close the form, the record is saved without any code being written. Once you start playing around with unbound controls then it becomes necessary to write code to save your work.