Repaint BackColor based on data entered (1 Viewer)

Mkkittrell

New member
Local time
Yesterday, 20:12
Joined
Sep 25, 2014
Messages
5
Hello, my issue is this - I am trying to color code text boxes based on the data entered in. The column is "PHASE" and the items entered in are either "1" "2" or "3". 1 is supposed to be Red, 2 Yellow, 3 Green.

I have Microsoft Access XP (I'm sure). I've tried to do it on VB and had no luck. I couldn't figure out Macro and I don't have On Click or Code Builder.

I have tried a couple of different expressions and no luck. I'm definitely an amateur to Access. I'm only using it cause it's what we have in the office.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 04:12
Joined
Jul 9, 2003
Messages
16,271
Create a test form place some text boxes and command buttons on it.

Experiment with changing the text box colours until you have it working nicely and report back.
 

Mkkittrell

New member
Local time
Yesterday, 20:12
Joined
Sep 25, 2014
Messages
5
Okay, I was able to create a Form using the Wizard and do Conditional Formatting. In the end I was able to color code those. But now I'm missing some information as the original table had a relationship with another table and I am incapable of figuring out how to create a relationship between forms. Any solutions?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 04:12
Joined
Jul 9, 2003
Messages
16,271
I'm not sure what you mean by create a relationship between forms please could you elaborate and provide some sample data.
 

Mkkittrell

New member
Local time
Yesterday, 20:12
Joined
Sep 25, 2014
Messages
5
My apologies, I am more than likely not using the correct terminology. The original set of data was on a Table that had a relationship with another table in order to have a subdata sheet. The program wouldn't allow me to do conditional formatting on a table so I had to make a duplicate set of records under the "Form". If this makes any sense.

The issue I now have is that I don't have a subdata sheet on the form and I did not see a way to make one without being on a table.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 04:12
Joined
Jul 9, 2003
Messages
16,271
I'm still not ready grasping what the issue is. I though I should mention sub forms.

You can have the main form showing one record, and then a subform displaying a list of records related to that one record.

The subform records would contain a field which had a matching ID to the ID of the main form (single record with ID) Multiple records in the subform with a column with the same ID.
 
Last edited:

Mkkittrell

New member
Local time
Yesterday, 20:12
Joined
Sep 25, 2014
Messages
5
On the list of objects there are "Table", "Query", "Form", "Report", and "Data Access". The original list of records are located under a table and I could create a subdata sheet on there. Basically what you're talking about. I can't seem to find a way to do that on a Form though.
 

Mkkittrell

New member
Local time
Yesterday, 20:12
Joined
Sep 25, 2014
Messages
5
Okay so how would I go about creating a Subform in Microsoft Access XP? Everything I can find on the net is for 2007 or 2010. I tried doing it through Form Wizard.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 04:12
Joined
Jul 9, 2003
Messages
16,271
Okay so how would I go about creating a Subform in Microsoft Access XP? Everything I can find on the net is for 2007 or 2010. I tried doing it through Form Wizard.

I assume it would be the same... However here is a set of instructions that I did for another OP. Should get you started...

Create a blank form. Name this form "frmMain". Place on this form a command button and a text box.

Select your query or table, just highlight it where it appears in the column on the left of the screen, now press one of the buttons that creates a form.

You should now have a form based on the query. Name this form "sfrmOne" Now open the form in design view change it to a form that shows in datasheet view. You may need to find YouTube videos or other resources to direct you how to do this.

Make sure all the forms and queries are closed. Now open frmMain in design view, drag the form "sfrmOne" on to the frmMain.

Change the name of the command button to "btnTest". Open the command button property sheet and find the on click event, press on the ellipsis and this will take you through to the code behind the form with the subroutine defined with a name something like btnTest _Click.

Place the following code in the command button subroutine:-

MsgBox " >>> " & " Testing"

save the form, press the button and report back what happens.
 

Users who are viewing this thread

Top Bottom