Okay, here goes.
Continuous forms... possibly the best feature of access. The only downside is this: the only way to have a conditional evaluation run on each record invididually is by conditional formatting... this poses a problem because it is extremely limited (no wildcards, cannot access controls other than the one the formatting is on, cannot perform evaluations other than the ones give... greater than, less than etc).
Is there a way, even if it involves cycling through each record via a for loop, to evaluate or even reference items on invididual lines...
Is there an array somewhere with each member of the 'master' control in it? If i say "chkbox.che cked = true" then obviously ALL of the checkboxes will check (for as many records as you have showing on your continuous form)... this is not what i'm looking for. Is there a way to programmaticall y ONLY check one of them (obviously clicking on it would work, but given only the index number of that record, ie: checkbox[4].checked = true)?
Here is an example that, if solved, I could adapt easily to do what I want:
You have a continuous form, some text boxes with their datasources set etc... now in design mode (which you only see your 'template' record), you have a lable, not linked to anything... just with static text in it (lets call it lblTest) and set its caption to 'Test'. Now there are 20 records... I have 20 'rows' on this form and each of them has a label that says "Test" and a bunch of varying information in the other linked text boxes...
if I simply code ... lblTest.caption = "changeme" ... then all 20 labels will change to that.. is there a way to change, say, only the 4th row label's caption? programatically without resorting to conditional formatting?
Hopefully this is a hurdle that can be overcome because it is extremely limiting.
11 3482 NeoPa 32,568
Recognized Expert Moderator MVP
I'm not too sure what effect could be achieved, but try playing with the OnCurrent event.
This should enable you to format individual records, but I'm not too sure about all the rest.
Play with it and see what you can do.
My question is, how do you figure Continuous forms... possibly the best feature of access when it allows you to do nothing that you wish to do? Continuous forms are undoubtedly the worst feature (form-wise) for all the reasons you've enumerated!
PEB 1,418
Recognized Expert Top Contributor
Hi
If you want on each row have different label....
The best way is to have separate field in your database ie Label1
There you can determine what information should be like Label...
By default you introduce a value but if there is a record with a label that should be different you change the field..
In your Continious form instaed to use the Label Control use the Field Control that is locked, filled like a label...and don't has the focus... And on clicking on this field create a function that sets the focus to the respective field to be updated...
Hope this helps
MMcCarthy 14,534
Recognized Expert Moderator MVP
Okay, here goes.
Continuous forms... possibly the best feature of access. The only downside is this: the only way to have a conditional evaluation run on each record invididually is by conditional formatting... this poses a problem because it is extremely limited (no wildcards, cannot access controls other than the one the formatting is on, cannot perform evaluations other than the ones give... greater than, less than etc).
Is there a way, even if it involves cycling through each record via a for loop, to evaluate or even reference items on invididual lines...
Is there an array somewhere with each member of the 'master' control in it? If i say "chkbox.che cked = true" then obviously ALL of the checkboxes will check (for as many records as you have showing on your continuous form)... this is not what i'm looking for. Is there a way to programmaticall y ONLY check one of them (obviously clicking on it would work, but given only the index number of that record, ie: checkbox[4].checked = true)?
Here is an example that, if solved, I could adapt easily to do what I want:
You have a continuous form, some text boxes with their datasources set etc... now in design mode (which you only see your 'template' record), you have a lable, not linked to anything... just with static text in it (lets call it lblTest) and set its caption to 'Test'. Now there are 20 records... I have 20 'rows' on this form and each of them has a label that says "Test" and a bunch of varying information in the other linked text boxes...
if I simply code ... lblTest.caption = "changeme" ... then all 20 labels will change to that.. is there a way to change, say, only the 4th row label's caption? programatically without resorting to conditional formatting?
Hopefully this is a hurdle that can be overcome because it is extremely limiting.
If you just want to toggle between two label values then I would suggest creating two labels and making one of them invisible. Then put something like this in the Form_Current event. -
-
Private Sub Form_Current()
-
-
If <conditional statement> Then
-
Me.lblFirstLabelName.Visible = True
-
Me.lblSecondLabelName.Visible = False
-
Else
-
Me.lblFirstLabelName.Visible = False
-
Me.lblSecondLabelName.Visible = True
-
End If
-
-
End Sub
-
-
PEB 1,418
Recognized Expert Top Contributor
Or simply changing the label Caption like this:
If testvalue=testr esult then
Me.lblFirstLabe lName.Caption = "Les banans viennent de:"
Else
Me.lblFirstLabe lName.Caption = "Les abricots sont:"
end if
If you just want to toggle between two label values then I would suggest creating two labels and making one of them invisible. Then put something like this in the Form_Current event. -
-
Private Sub Form_Current()
-
-
If <conditional statement> Then
-
Me.lblFirstLabelName.Visible = True
-
Me.lblSecondLabelName.Visible = False
-
Else
-
Me.lblFirstLabelName.Visible = False
-
Me.lblSecondLabelName.Visible = True
-
End If
-
-
End Sub
-
-
Or simply changing the label Caption like this:
If testvalue=testr esult then
Me.lblFirstLabe lName.Caption = "Les banans viennent de:"
Else
Me.lblFirstLabe lName.Caption = "Les abricots sont:"
end if
I think that the form_current has some potential, I'll try it and see what happens!
btw the reason I said that continuous forms was possibly the best feature is because it would take you several weeks to make a datagrid in vb.net that gives you the same effect. Everything else that access has going for it, some other language/ide can do better.
PEB - your suggestion only works when you have 1 label... if you have several, ie: on a continuous form, you would find that it changes all the labels captions depending on that 1 if statement.
PEB 1,418
Recognized Expert Top Contributor
Yeap sure with this code:
Originally Posted by PEB
Or simply changing the label Caption like this:
If testvalue=testr esult then
Me.lblFirstLabe lName.Caption = "Les banans viennent de:"
Else
Me.lblFirstLabe lName.Caption = "Les abricots sont:"
end if
But if you catch my previous idea... To create a field in your table, named label...
And programatically change it's content... The field used for label should change and only on the respective record!
I give garantees!
PLS belive me! ;)
MMcCarthy 14,534
Recognized Expert Moderator MVP
Yeap sure with this code:
But if you catch my previous idea... To create a field in your table, named label...
And programatically change it's content... The field used for label should change and only on the respective record!
I give garantees!
PLS belive me! ;)
That's a great idea PEB.
PEB 1,418
Recognized Expert Top Contributor Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jouke Langhout |
last post by:
Hello all!
For quite some time now, I've got the following problem:
Access won't close properly when a user closes the application. An
ACCESS process stays active and that process can only be terminated by
pressing ++ and then terminate the process.
I searched the entire internet and found out that there could be two
things wrong (both of them are mentioned in the bug list on the access
|
by: Bradley |
last post by:
I have an A2000 database in which I have a continuous form with a tick
box. There is also a text box with a conditional format that is based on
the expression , if it's true then change the background
colour.
In A2000 it works great, but in A2003 the background doesn't always
change and when it does it only changes when the record looses the
focus.
Any way around this? Is it a bug? Or have they "improved" it?
|
by: Dimitri Furman |
last post by:
Given:
Access 2002/2003
A subform in datasheet or continuous view, placed on a tab page (this last
may or may not matter)
Conditional formatting applied to some controls on the subform -
format expressions are the same for all controls
Under some undetermined circumstances, when such subform is displayed, the
controls on the subform start to visibly flicker, the cursor in the subform
stops blinking, and CPU utilization goes to 100%....
|
by: Paul T. Rong |
last post by:
I don't know why that I lost track of the post. I found it from the
newsgroup and paste last two posts.
Pieter Linden said:
"To do this - use conditional formatting..."
I didn' work it out. Seems to complicated. Can anyone help with this
conditional formatting?
Thanks
Paul
|
by: GGerard |
last post by:
Hello
Is there a way to use a variable in the Conditional Formatting of a Textbox?
Example :
I want the background of a textbox in a continuous form to change color when
the value of "MyField1" is True.
No problem, I just need to write "Expression is" and " = -1 "
| |
by: jodyblau |
last post by:
I'm not certain that what I am trying to do is possible; in any event I
haven't been able to figure it out. Here is what I am trying to do:
I have one table that has a list of cases I'm working on. I have a
second table that contains a list of tasks to be performed and relates
to the Case_List through a Case_ID.
So currently, I can bring up a form that has a list of all my cases, I
can then select a case and it opens a new form that...
|
by: Typehigh |
last post by:
I have many text fields with conditional formatting applied,
specifically when the condition is "Field Has Focus". Without any
events associated with the fields the conditional formatting works
perfectly. However, I have code that runs under the ON CLICK event. The
code changes the focus to other controls, which means the conditional
formatting is no longer displayed. This part makes sense to me.
Here's what doesn't make sense. The last...
|
by: midlothian |
last post by:
Hello,
I have conditional formatting set up on a subform based on a calculated
value in the underlying query. For instance, if Sales are >$1000, the
query displays "Yes," otherwise it displays "No." The conditional
formatting is set up to read the 'Yes' or 'No' value and color the text
accordingly.
I have an event in the subform that allows users to update the sales.
It actually runs an update query behind the scenes. What I want to...
|
by: Lyn |
last post by:
Hi,
I would like to make a bound text box not visible if it is empty (not just
disable it). This option is not available from the standard conditional
formatting feature (at least, not that I can find).
I thought of calling a class module function via Expression Builder for the
control. I have written a basic function, but don't seem to be able to
pass the relevant arguments correctly. It seems to me that I need to pass
two...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |