Help me format my form:)

Swillsy

Registered User.
Local time
Today, 18:34
Joined
Jun 10, 2008
Messages
68
Hi All,
I've just realised after a couple of days of staring at my editor my VBA skills are limited to functions.
I have a problem - I would like to change the background colour of an unbound label depending on a value (yes/No) in a table.

The labels are all captioned which match with the table ie a1,a2

Can anyone please help me:)
Thanks

James
 
Something like:

If Me.ControlName = > 1
lblYourLabelName.BackColour = vbRed
Else If Me.ControlName = < 1
lblYourLabelName.ForeColor = vbGreen
EndIf

When you type lblYourLabelName and then a full stop you should get a menu of thingsl ike the caption/colour/size etc of the text. I use it to provide a summary of a customer's contact history in this example i.e. "Emailed", "Telephoned" etc.

Poast back if you need more help.

:)
 
Something like:

If Me.ControlName = > 1
lblYourLabelName.BackColour = vbRed
Else If Me.ControlName = < 1
lblYourLabelName.ForeColor = vbGreen
EndIf


:)

Cheers 2plus2 I actually managed to change the format for one of my labels however i'm still going about it all wrong:(
I have attached the form and relating table from the db im currently working on so you can see where I'm messing up. How can i make all the labels search for their 'status' in the table. I'm trying to make a visual display of availability btw:)
 

Attachments

That's a lot of labels...

I'll have to have a think but I have a feeling there is an easier way to do this as opposed to looping through each label etc.

I think some of the "more experienced" posters might have a better solution.
 
Yes I know :rolleyes:
If this was excel i would be able to do it though:(
Thanks for having a look at it 2plus2:)
 
I think you need to work on your table structure. At the moment each box is related to one record (set navigation to yes in the form properties), so only one label per record would ever be a different color. Not sure if that is what your looking for.

If you can do it excel, whip up and post a sample.

Dave
 
Morning Dave,

I've added a very basic example of how i would like it to work in excel.

The table will have a fixed number of records as these are the only halls used by the college. At present I just want to give the users a visual display of availability - using dates as a variable in a append query as the relating table

I have seen another database use a method very similar to this in a form however cannot find it anywhere.

Thanks for looking

James
 

Attachments

Ah, as I thought. But you want to books rooms in advance. You will need different records for different days.
 
But you want to books rooms in advance. You will need different records for different days.

90% of bookings wil lbe for a whole term so I have created a temporary table based on dates linked to a scheduling table.
I have seem this before on a cinema booking database I think. I am just unsure how to get vb to pick up the lables via the captions:(
 
Do you mean how to format them based on a record in a table/query? i.e. if it's booked alter the format?
 
yeah, on the db i attached it has the form and a table
the table has the caption names and a checkbox for 'status'
if status is checked then I would like the backcolor to change to red etc.
:)
 
How many labels are you using? The same amount?

I can't think of how to do it with that many aside from declaring each on as a variable which probably isn't feasible... You'll want to open the table/query in a recordset and format accordingly, which isn't too hard.

Figuring out a way to order the data is probably more important at this stage.

OSG,

Do you have any suggestions?
 
yes there will always be the same amount of rooms.
I found the seating database I am trying to copy however I cannot make any sense of the actualy code regarding setting up the seats in VB.
 

Attachments

Users who are viewing this thread

Back
Top Bottom