Using continuous forms instead of creating controls:)

Kingz

Member
Local time
Today, 03:25
Joined
Mar 19, 2024
Messages
63
Hi guys.

First of all, thanks to MajP, isladogs, pat Hartmann, GPGeorge, Arnelgp , and anyone I might have forgotten for the discussion on not misusing ms Access by creating controls dynamically, and for the advice and discussion on the topic.

It was merely out of laziness that I didn't want to change my application, but in the long run, it does make sense, after I saw how a continuous form could be.

So, just to give you information on my particular problem and why I resorted falsely to creating controls dynamically:

I have tables of information which I can use to create tabs and listed control on these tabs.. the information changes quite regularly, so I need a way of creating the information dynamically.
I have tabs which are topics, and with each topic, I have text boxes and combo boxes which need to be displayed and editable,as well as contents for labels, next to these boxes of course. So, I stupidly thought I would create everything with
Set CTL=CreateControl("formname",aclabel or acTextbox or accombobox,etc ...

After all, each tab has a different composition of various boxes.
I then have a large drop down table where I fill the combo boxes involved.

Now, the reason I hope to have less problems when using continuous forms is with the "save" function. I have two of these.. the important one is a save function which records the name of the user on the dataset, after checking that all girls are filled out, or selected. The 2nd save is to save a temporary state, so it saves without a " signature" and allows the user to continue later. I have solutions to all of that, but I need to fiddle with form.dirty on before_update, which is a method not very nice, and seems to not work properly. So now I'm all ears as to how I can use continuous forms in tabs to get what I want with form header and footer of continuous forms In tabs..that's possible, right?
 
Rather than describing the problem - show some screenshots - from the description you don’t need any code, just a conditional username value based on which save button is clicked
 
Dynamically creating controls is not recommended and doesn't really work in some situations. Hiding and displaying controls, as demonstrated in your other thread is a more practical approach. But, if you can use a continuous form, it would be the best and simplest solution. Almost anything can be achieved in Access, especially with code.
 
but I need to fiddle with form.dirty on before_update, which is a method not very nice, and seems to not work properly.
Understanding the event model is the key to using it correctly. Here's a sample that will help you. It focuses on the form's BeforeUpdate event since that is the most important event when you are updating a bound form. I suggest watching at least one of the videos before jumping into the sample database so you can understand how the sample works.
So now I'm all ears as to how I can use continuous forms in tabs to get what I want with form header and footer of continuous forms In tabs..that's possible, right?
A continuous form is simply the same form rendered multiple times each iteration showing a different record. Only ONE of these iterations can have the focus at one time. Therefore, a continuous form works EXACTLY the same way a single record form works since the form's code is only ever looking at a single record at a time. The form is bound to the Current record. The record pointer (if you leave it visible) shows visually which record has the focus. That is the record your code will be looking at. So, your code doesn't loop through the records and run against all records. It runs against ONE record. You change the form's focus to a different record and the same code runs against the new current record.
 

Users who are viewing this thread

Back
Top Bottom