Hi.
I'm using a combo box to select records to display. Only problem is it
doesn't work!
The Combo box is called PropertyChoice and is derived from
Addresses.Property. The rest of the form then selects Addresses.* and should
populate with the full address of the property.
Whenever I run the form it asks me for the value of the PropertyChoice,
which suggests to me that the value of the Combo box is not being recognised.
I have put a requery action in the Events section on AfterUpdate, but apart
from not working I suspect that it is more fundamental than this!
As ever any help is greatly appreciated - these forums have taught me
everything I know about Access!
Kind Regards,
Russell.
What version of Access are you using? Did you use the ComboBox wizard to
create your cbo control?
>Hi.
>
[quoted text clipped - 16 lines]
>Kind Regards,
>Russell.

Signature
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.
Pascoe - 20 May 2008 17:08 GMT
Hi there!
I'm using Access 2007, and Yes, I did use the Wizard (before I started
tinkering with it after it didn't work).
Interestingly I just tried displaying [PropertyChoice] in a text box to see
if it I could see the choice - and I can't, it doesn't display, so somehow I
don't seem to be storing the value in the combo box.
Regards,
Russell.
>What version of Access are you using? Did you use the ComboBox wizard to
>create your cbo control?
[quoted text clipped - 4 lines]
>>Kind Regards,
>>Russell.
Pascoe - 20 May 2008 17:08 GMT
Hi there!
I'm using Access 2007, and Yes, I did use the Wizard (before I started
tinkering with it after it didn't work).
Interestingly I just tried displaying [PropertyChoice] in a text box to see
if it I could see the choice - and I can't, it doesn't display, so somehow I
don't seem to be storing the value in the combo box.
Regards,
Russell.
>What version of Access are you using? Did you use the ComboBox wizard to
>create your cbo control?
[quoted text clipped - 4 lines]
>>Kind Regards,
>>Russell.
ruralguy - 20 May 2008 17:27 GMT
When you used the wizard, did you select the 3rd choice, "Find a record..."?
What is the RecordSource of your form and what are the RowSourceType and
RowSource of your combo box and which column is the cbo bound to?
>Hi there!
>
[quoted text clipped - 13 lines]
>>>Kind Regards,
>>>Russell.

Signature
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.
Russell Pascoe - 20 May 2008 17:43 GMT
I did do the 3rd Option.
Record Source = Don't seem to have that...? Is it the same as Control Source?
Which is blank.
Row Source Type = Table / Query
Row Source = SELECT Addresses.Property FROM Addresses;
>When you used the wizard, did you select the 3rd choice, "Find a record..."?
>What is the RecordSource of your form and what are the RowSourceType and
[quoted text clipped - 5 lines]
>>>>Kind Regards,
>>>>Russell.
ruralguy - 20 May 2008 17:54 GMT
The RecordSource is a form property and not a property of the ComboBox.
>I did do the 3rd Option.
>
[quoted text clipped - 10 lines]
>>>>>Kind Regards,
>>>>>Russell.

Signature
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.
Pascoe - 20 May 2008 18:06 GMT
My apologies - brain in neutral.
SELECT Addresses.* FROM Addresses WHERE [Addresses].[Property]=
[PropertyChoice];
>The RecordSource is a form property and not a property of the ComboBox.
>
[quoted text clipped - 3 lines]
>>>>>>Kind Regards,
>>>>>>Russell.
Pascoe - 20 May 2008 18:06 GMT
My apologies - brain in neutral.
SELECT Addresses.* FROM Addresses WHERE [Addresses].[Property]=
[PropertyChoice];
>The RecordSource is a form property and not a property of the ComboBox.
>
[quoted text clipped - 3 lines]
>>>>>>Kind Regards,
>>>>>>Russell.
ruralguy - 20 May 2008 18:52 GMT
So the RecordSource of the form is referencing the ComboBox on your form????
>My apologies - brain in neutral.
>
[quoted text clipped - 6 lines]
>>>>>>>Kind Regards,
>>>>>>>Russell.

Signature
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.
Pascoe - 20 May 2008 18:57 GMT
Yes, I guess it is. Is this wrong? I thought this was how I got the correct
record selected.
What should I be doing?
>So the RecordSource of the form is referencing the ComboBox on your form????
>
[quoted text clipped - 3 lines]
>>>>>>>>Kind Regards,
>>>>>>>>Russell.
ruralguy - 20 May 2008 19:07 GMT
Try setting the RecordSource of the form to:
SELECT * FROM Addresses
...and then use the ComboBox wizard to create another cbo that will "Find a
record..." for you.
>Yes, I guess it is. Is this wrong? I thought this was how I got the correct
>record selected.
[quoted text clipped - 6 lines]
>>>>>>>>>Kind Regards,
>>>>>>>>>Russell.

Signature
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.
Pascoe - 20 May 2008 19:27 GMT
Thank you for your efforts, but unfortunately that doesn't seem to do it!
In fact when I did do this Access only came up with two optinos in the Wizard,
and one of them was not the "Find a record" for you one...!
>Try setting the RecordSource of the form to:
>SELECT * FROM Addresses
[quoted text clipped - 7 lines]
>>>>>>>>>>Kind Regards,
>>>>>>>>>>Russell.
ruralguy - 20 May 2008 20:16 GMT
That happens when there is no RecordSource for the form. Create a query then
and bind that to your form.
>Thank you for your efforts, but unfortunately that doesn't seem to do it!
>
[quoted text clipped - 6 lines]
>>>>>>>>>>>Kind Regards,
>>>>>>>>>>>Russell.

Signature
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.
Linq Adams - 20 May 2008 19:08 GMT
I'm going to guess that your problems may be coming from
Addresses.Property
Property is a Reserved Word in Access, and I'm guessing it's confusing the
Access Gnomes. You need to change the field's name to something else,
everywhere it appears. You need to do this even if it's not causing this
particular problem (and it may be) because sooner or later it will trip you
up.

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003
ruralguy - 20 May 2008 19:19 GMT
Good catch Linq. I missed that one completely.
>I'm going to guess that your problems may be coming from
>
[quoted text clipped - 5 lines]
>particular problem (and it may be) because sooner or later it will trip you
>up.

Signature
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.
Pascoe - 20 May 2008 19:48 GMT
So change all of my tables that use the name Property - bottom line?
Thank you!
>I'm going to guess that your problems may be coming from
>
[quoted text clipped - 5 lines]
>particular problem (and it may be) because sooner or later it will trip you
>up.
Beetle - 20 May 2008 19:36 GMT
Nothing wrong with using the combo box value as criteria for your
recordsource, but you're not referencing it correctly. It should be;
SELECT Addresses.* FROM Addresses WHERE [Addresses].[Property]=
Forms!NameOfYourForm![PropertyChoice];
and you'll need to add a Requery to the After Update event of the combo box.
BTW - Linq is right, you should change the name of the Property field. For
more on Access reserved words, see;
http://allenbrowne.com/AppIssueBadWord.html

Signature
_________
Sean Bailey
> My apologies - brain in neutral.
>
[quoted text clipped - 8 lines]
> >>>>>>Kind Regards,
> >>>>>>Russell.
Pascoe - 21 May 2008 10:09 GMT
BINGO!
I have tinkered with so many parts of this and got so close previousoy
without realising it!
I changed all the field names with "Property" in, to "Property Name" (Thanks
Linq)
I also changed the format of my SQL to what you suggested, and FINALLY it all
works.
I am very very grateful for everyone's input - thank you.
>Nothing wrong with using the combo box value as criteria for your
>recordsource, but you're not referencing it correctly. It should be;
[quoted text clipped - 14 lines]
>> >>>>>>Kind Regards,
>> >>>>>>Russell.