Changing background color of items in combo list

Repent…please.

Here it is as I see it.

I only want to know if the last upload of mine works after being converted to Access 2010.

I can’t help you with your database, I don’t have Access 2010 to test it in and I don’t intend to buy it just to help you.
I write in Access 2003 and you test what I write in Access 2010, nothing more.

So the question is; did what I write in post #37 work correctly after being converted to Access 2010?

Chris.
 
Repent…please.

Here it is as I see it.

I only want to know if the last upload of mine works after being converted to Access 2010.

I can’t help you with your database, I don’t have Access 2010 to test it in and I don’t intend to buy it just to help you.
I write in Access 2003 and you test what I write in Access 2010, nothing more.

So the question is; did what I write in post #37 work correctly after being converted to Access 2010?

Chris.

No it does not work correctly in v2010. :eek:

I created a XP Pro VM and installed Access 2003 SP3 to it. I ran your DB in 2003 and it works. Not sure why I'm seeing the errors and broken functionality in v2010.

Since I have both versions of Access, is there anything I can do to get this to work from 2003 to 2010? Maybe cleanup tables, etc in v2003 then save?
 
Well so far I've exported just the form and the two tables, the productionNumbers and productionHours tables, needed to drive the control to a blank 2003 DB and from there, tried to run that new 2003 DB in Access 2010. Same anomalies as posted in #38.

Guess I'll see what else I can try. Don't understand why importing from 2003 to 2010 would break the whole thing. Thanks for all your help thus far. I can understand your not wanting to spend further time on this.

chris
 
Well, I don’t known why it doesn’t work in Access 2010 and I can’t test it.

Perhaps someone with Access 2010 can help.

Chris.
 
When I look at the DB in post 37, what I find is that the control "txtSelection" Needs to be requeried in the click events for both list boxes before they are set to being invisible. Using A2010

When I look at the DB in post 26, it works just fine in A2010 as a .mdb if I am reading the intention of the poster correctly. When I import everything in to .accdb it still works just fine.

Am I missing something?
 
When I look at the DB in post 37, what I find is that the control "txtSelection" Needs to be requeried in the click events for both list boxes before they are set to being invisible. Using A2010

When I look at the DB in post 26, it works just fine in A2010 as a .mdb if I am reading the intention of the poster correctly. When I import everything in to .accdb it still works just fine.

Am I missing something?


Please expound on what you mean in your first paragraph about control "txtSelection" needing to be requeried?

chris
 
Please expound on what you mean in your first paragraph about control "txtSelection" needing to be requeried?

chris

Nevemind, I misunderstood what the problem was - I thought you were talking about the controls on frmNewTimes.
 
Nevemind, I misunderstood what the problem was - I thought you were talking about the controls on frmNewTimes.

if you have A2010 maybe you could look at the DB in post #37 and see if it works for you? I can open it and the control will run, but if you follow the posts after #37 you'll see where the issue is.

chris
 
Well I may be on to something here. I commented out the code that the debugger was complaining about and now the control runs on the form without error messages, (except that the two list boxes stay expanded. It doesn't auto collapse when the form is opened, or after a selection is made. It also doesn't collapse when moving to a new record. Nor does it color the time selection although the time is now placed into the text box.)

I created a new record incorporating this control and it was recorded to the DB with no errors, just the collapsing/expounding mentioned and coloring of selected time above.

Further along anyway.

chris
 
Last edited:
Kryst51;

have you had a chance to look into this?

chris

Hey, I'm sorry, work has been a little crazy, I haven't yet, I will try to today. In the meantime, if someone else can help please do!
 
OK, Given the form in the DB in Post 37 that you asked me to look at I found the following:

You needed to add the ".Column(2)" so that it knew to look at the bound column of the listbox.
Code:
Private Sub lstDayShift_Click()
    Me.lstNightShift = Null
    
    [COLOR=red]Me!TimeID = Me.lstDayShift.Column(2)
[/COLOR]     
    SetShiftColours Me!TimeID
   
    SetVisibility False
End Sub

The same with this one:
Code:
Private Sub lstNightShift_Click()
    Me.lstDayShift = Null
    [COLOR=red]Me!TimeID = Me.lstNightShift.Column(2)
[/COLOR]    
    SetShiftColours Me!TimeID
    SetVisibility False
End Sub

Then Here you need to requery "txtSelection"
Code:
Sub SetShiftColours(ByVal intShift As Integer)
    
    With Me.txtSelection
        If intShift <= 6 Then
            .BackColor = Me.lstDayShift.BackColor
            .ForeColor = Me.lstDayShift.ForeColor
            [COLOR=red].Requery
[/COLOR]        Else
            .BackColor = Me.lstNightShift.BackColor
            .ForeColor = Me.lstNightShift.ForeColor
            [COLOR=red].Requery
[/COLOR]        End If
    End With
    
End Sub

It works for me if I do these things. I tried it both as a 2003 in 2010, and converting it to 2007 version. Both are attached
 

Attachments

Thanks for testing that, Kryst51.

I might call that a bug in A2010.

In A2003 Me.lstDayShift refers to the bound column which is the ID column.

In A2010 it seems to require Me.lstDayShift.Column(2) which is the ID column.

If indeed that does fix the problem then there could be a lot of List Boxes, and perhaps Combo Boxes, that might go belly up when converted.

Interesting stuff and thanks again for testing it.

Regards,
Chris.
 
Thanks for testing that, Kryst51.

I might call that a bug in A2010.

In A2003 Me.lstDayShift refers to the bound column which is the ID column.

In A2010 it seems to require Me.lstDayShift.Column(2) which is the ID column.

If indeed that does fix the problem then there could be a lot of List Boxes, and perhaps Combo Boxes, that might go belly up when converted.

Interesting stuff and thanks again for testing it.

Regards,
Chris.

Hey, I show that the bound column is column 3 (And it is the ID) - See Screenshot

EDIT: Also, Your welcome for the testing
 

Attachments

  • BoundColumn3.gif
    BoundColumn3.gif
    66.9 KB · Views: 146
Yep, and that what makes it kind of scary.

If you don’t mind could you please test this one last thing for me in A2010?

In the event:
Private Sub lstDayShift_Click()

Could you add this line a see what shows up?

MsgBox Me.lstDayShift & " " & Me.lstDayShift.Column(2)

In A2003 it shows the ID in both cases but I can’t test to see if A2010 shows the same.

Thanks again for the testing.

Regards,
Chris.
 
Sure I can, I'll do it right now, but it was my understanding that you always had to use ".Column(x)" In these cases.

So I tested it and the message box comes out the same.
 
In the past, Me.lstDayShift would refer to the bound column even if that column had a width of 0.

It seems as if the MsgBox confirms that still to be the case in A2010.

So why it is now necessary is beyond me. :confused:

Thanks again,
Chris.
 
I have always had problems with list boxes if I didn't declare the column, even in A2003. I think it was a thread I had on here that someone told me about that.
 

Users who are viewing this thread

Back
Top Bottom