PC Review


Reply
Thread Tools Rate Thread

Access Combo Box controls for current record only

 
 
=?Utf-8?B?Z2RmYXN0YmFsbA==?=
Guest
Posts: n/a
 
      20th May 2007
I have created a form to keep track of a video collection. I have 2 combo
boxes and a text box that are "linked". The first combo box is a yes/no box
that tells if the video is owned. The second combo box is a list box that has
options such as "currently with Bob" or "currently with Joe", etc. The text
box is a "checked out to..." box that allows users to enter a name.

I have written the code in VBA to disable the 2nd combo box and text box if
the first combo box is set to "no". My problem is that the code works but
disables the 2nd combo box and text box for all records rather than just for
that record. I need to have each record independent of the others in this
regard.

Here is the code I have for the 1st combo box:

Private Sub OriginalCopy1_AfterUpdate()
If OriginalCopy1.Value = "No" Then
CheckoutStatus1.Enabled = False
CheckoutStatus1.Value = ""
CheckedOutTo1.Enabled = False
CheckedOutTo1.Value = ""
Else
CheckoutStatus1.Enabled = True
CheckedOutTo1.Enabled = True
End If
End Sub

Please help me!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Z2RmYXN0YmFsbA==?=
Guest
Posts: n/a
 
      20th May 2007
Cancel that. I had searched for this previously but wasn't able to find an
answer. However, I just found my answer indirectly by looking at the other
posts to similar questions. The problem was that I was not putting this code
on the OnCurrent property for the form as well. I don't remember who posted
the info I was looking for, but thanks to everybody just in case. I love
this forum.

"gdfastball" wrote:

> I have created a form to keep track of a video collection. I have 2 combo
> boxes and a text box that are "linked". The first combo box is a yes/no box
> that tells if the video is owned. The second combo box is a list box that has
> options such as "currently with Bob" or "currently with Joe", etc. The text
> box is a "checked out to..." box that allows users to enter a name.
>
> I have written the code in VBA to disable the 2nd combo box and text box if
> the first combo box is set to "no". My problem is that the code works but
> disables the 2nd combo box and text box for all records rather than just for
> that record. I need to have each record independent of the others in this
> regard.
>
> Here is the code I have for the 1st combo box:
>
> Private Sub OriginalCopy1_AfterUpdate()
> If OriginalCopy1.Value = "No" Then
> CheckoutStatus1.Enabled = False
> CheckoutStatus1.Value = ""
> CheckedOutTo1.Enabled = False
> CheckedOutTo1.Value = ""
> Else
> CheckoutStatus1.Enabled = True
> CheckedOutTo1.Enabled = True
> End If
> End Sub
>
> Please help me!

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo box updates first record not current Lisa Microsoft Access Forms 5 9th Sep 2009 10:28 AM
RE: combo box display current record value Ray Microsoft Access Form Coding 0 23rd Jul 2009 10:29 PM
Combo Box - Display value of current record ToniS Microsoft Access 0 28th Jan 2008 10:37 PM
change color of controls on current record only =?Utf-8?B?Q2hhY2U=?= Microsoft Access Form Coding 0 22nd Dec 2004 11:55 PM
Changing the current record for bound controls Cato Lommerud Microsoft VB .NET 0 5th Aug 2004 03:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:13 PM.