dbTalk Databases Forums  

Combo box changed in A2010

comp.databases.ms-access comp.databases.ms-access


Discuss Combo box changed in A2010 in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ron paii
 
Posts: n/a

Default Combo box changed in A2010 - 05-23-2011 , 10:31 AM






I noticed a change in how combo boxes return the selected value between
Access 97 to Access 2010.
The following query is the source for a combo box returning the 2nd column

SELECT qryPOInvAmount.InvAmont AS InvSum, qryPOInvAmount.[PO],
qryPOInvAmount.[Inv] FROM qryPOInvAmount GROUP BY qryPOInvAmount.InvAmont,
qryPOInvAmount.[PO], qryPOInvAmount.[Inv] ORDER BY qryPOInvAmount.InvAmont
DESC;

The PO number is a 0 padded number like this "00123456", Access 97 returns
the number with the 0 padding; Access 2010 returns the number without the 2
leading zeros. I am looking for a setting to NOT edit the selected PO
number. The combo box shows the PO number correctly.

Reply With Quote
  #2  
Old   
Phil
 
Posts: n/a

Default Re: Combo box changed in A2010 - 05-23-2011 , 11:24 AM






On 23/05/2011 16:31:52, "ron paii" wrote:
Quote:
I noticed a change in how combo boxes return the selected value between
Access 97 to Access 2010.
The following query is the source for a combo box returning the 2nd column

SELECT qryPOInvAmount.InvAmont AS InvSum, qryPOInvAmount.[PO],
qryPOInvAmount.[Inv] FROM qryPOInvAmount GROUP BY qryPOInvAmount.InvAmont,
qryPOInvAmount.[PO], qryPOInvAmount.[Inv] ORDER BY qryPOInvAmount.InvAmont
DESC;

The PO number is a 0 padded number like this "00123456", Access 97 returns
the number with the 0 padding; Access 2010 returns the number without the
2 leading zeros. I am looking for a setting to NOT edit the selected PO
number. The combo box shows the PO number correctly.


Try
SELECT InvAmount AS InvSum, Cstr(Format(PO,"0000000")), Inv
FROM qryPOInvAmount GROUP BY InvAmont,
GROUP BY Cstr(Format(PO,"0000000")), Inv
ORDER BY InvAmont DESC;

With only a single table / query as the source, you don't need to specify the
query name with each field, and you only need square brackets if the field
name has a space in it, or you are using a reserved word such as [Date]

Phil

Reply With Quote
  #3  
Old   
ron paii
 
Posts: n/a

Default Re: Combo box changed in A2010 - 05-23-2011 , 12:41 PM



"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote

Quote:
On 23/05/2011 16:31:52, "ron paii" wrote:
I noticed a change in how combo boxes return the selected value between
Access 97 to Access 2010.
The following query is the source for a combo box returning the 2nd
column

SELECT qryPOInvAmount.InvAmont AS InvSum, qryPOInvAmount.[PO],
qryPOInvAmount.[Inv] FROM qryPOInvAmount GROUP BY
qryPOInvAmount.InvAmont,
qryPOInvAmount.[PO], qryPOInvAmount.[Inv] ORDER BY
qryPOInvAmount.InvAmont
DESC;

The PO number is a 0 padded number like this "00123456", Access 97
returns
the number with the 0 padding; Access 2010 returns the number without the
2 leading zeros. I am looking for a setting to NOT edit the selected PO
number. The combo box shows the PO number correctly.



Try
SELECT InvAmount AS InvSum, Cstr(Format(PO,"0000000")), Inv
FROM qryPOInvAmount GROUP BY InvAmont,
GROUP BY Cstr(Format(PO,"0000000")), Inv
ORDER BY InvAmont DESC;

With only a single table / query as the source, you don't need to specify
the
query name with each field, and you only need square brackets if the field
name has a space in it, or you are using a reserved word such as [Date]

Phil
Thank you

Cstr(Format(PO,"0000000")) did not help. PO is a text field and the combo
box shows the data correctly but A2010 is converting the return value to
integer.

Reply With Quote
  #4  
Old   
Phil
 
Posts: n/a

Default Re: Combo box changed in A2010 - 05-23-2011 , 05:17 PM



On 23/05/2011 18:41:45, "ron paii" wrote:
Quote:

"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote in message
news:ire1nd$gp1$1 (AT) speranza (DOT) aioe.org...
On 23/05/2011 16:31:52, "ron paii" wrote:
I noticed a change in how combo boxes return the selected value between
Access 97 to Access 2010.
The following query is the source for a combo box returning the 2nd
column

SELECT qryPOInvAmount.InvAmont AS InvSum, qryPOInvAmount.[PO],
qryPOInvAmount.[Inv] FROM qryPOInvAmount GROUP BY
qryPOInvAmount.InvAmont,
qryPOInvAmount.[PO], qryPOInvAmount.[Inv] ORDER BY
qryPOInvAmount.InvAmont
DESC;

The PO number is a 0 padded number like this "00123456", Access 97
returns
the number with the 0 padding; Access 2010 returns the number without the
2 leading zeros. I am looking for a setting to NOT edit the selected PO
number. The combo box shows the PO number correctly.



Try
SELECT InvAmount AS InvSum, Cstr(Format(PO,"0000000")), Inv
FROM qryPOInvAmount GROUP BY InvAmont,
GROUP BY Cstr(Format(PO,"0000000")), Inv
ORDER BY InvAmont DESC;

With only a single table / query as the source, you don't need to specify
the
query name with each field, and you only need square brackets if the field
name has a space in it, or you are using a reserved word such as [Date]

Phil

Thank you

Cstr(Format(PO,"0000000")) did not help. PO is a text field and the combo
box shows the data correctly but A2010 is converting the return value to
integer.


Sorry Ron, didn't realise the question was from an experienced Access guy.
I have created a table with text fields Test, values "12345" and "23456"
My query for the combo rowSource is
SELECT Table1.ID, Right("0000000" & [Test],8) AS Expr1 FROM Table1;

On the AfterUpdate of Combo0 I run
Private Sub Combo0_AfterUpdate()

MsgBox "Test " & Combo0.Column(1)
End Sub

Results are exactly as expected, not as you describe. - Odd
Using Access 2010 32 bit

Phil

Reply With Quote
  #5  
Old   
ron paii
 
Posts: n/a

Default Re: Combo box changed in A2010 - 05-25-2011 , 07:01 AM



"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote

Quote:
On 23/05/2011 18:41:45, "ron paii" wrote:


"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote in message
news:ire1nd$gp1$1 (AT) speranza (DOT) aioe.org...
On 23/05/2011 16:31:52, "ron paii" wrote:
I noticed a change in how combo boxes return the selected value between
Access 97 to Access 2010.
The following query is the source for a combo box returning the 2nd
column

SELECT qryPOInvAmount.InvAmont AS InvSum, qryPOInvAmount.[PO],
qryPOInvAmount.[Inv] FROM qryPOInvAmount GROUP BY
qryPOInvAmount.InvAmont,
qryPOInvAmount.[PO], qryPOInvAmount.[Inv] ORDER BY
qryPOInvAmount.InvAmont
DESC;

The PO number is a 0 padded number like this "00123456", Access 97
returns
the number with the 0 padding; Access 2010 returns the number without
the
2 leading zeros. I am looking for a setting to NOT edit the selected PO
number. The combo box shows the PO number correctly.



Try
SELECT InvAmount AS InvSum, Cstr(Format(PO,"0000000")), Inv
FROM qryPOInvAmount GROUP BY InvAmont,
GROUP BY Cstr(Format(PO,"0000000")), Inv
ORDER BY InvAmont DESC;

With only a single table / query as the source, you don't need to
specify
the
query name with each field, and you only need square brackets if the
field
name has a space in it, or you are using a reserved word such as [Date]

Phil

Thank you

Cstr(Format(PO,"0000000")) did not help. PO is a text field and the combo
box shows the data correctly but A2010 is converting the return value to
integer.



Sorry Ron, didn't realise the question was from an experienced Access guy.
I have created a table with text fields Test, values "12345" and "23456"
My query for the combo rowSource is
SELECT Table1.ID, Right("0000000" & [Test],8) AS Expr1 FROM Table1;

On the AfterUpdate of Combo0 I run
Private Sub Combo0_AfterUpdate()

MsgBox "Test " & Combo0.Column(1)
End Sub

Results are exactly as expected, not as you describe. - Odd
Using Access 2010 32 bit

Phil
Thanks' anyway.

I will keep looking at the code. The form was originally done in Access 2,
it must have some setting that makes it work different in 2010.

Reply With Quote
  #6  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Combo box changed in A2010 - 05-28-2011 , 02:23 PM



"ron paii" <none (AT) nospam (DOT) com> wrote in
news:irir2s$2i2$1 (AT) dont-email (DOT) me:

Quote:
I will keep looking at the code. The form was originally done in
Access 2, it must have some setting that makes it work different
in 2010.
Do you by chance have your A2010 database running with SQL ANSI 92
compatibility turned on?

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #7  
Old   
ron paii
 
Posts: n/a

Default Re: Combo box changed in A2010 - 05-31-2011 , 07:23 AM



"David-W-Fenton" <NoEmail (AT) SeeSignature (DOT) invalid> wrote

Quote:
"ron paii" <none (AT) nospam (DOT) com> wrote in
news:irir2s$2i2$1 (AT) dont-email (DOT) me:

I will keep looking at the code. The form was originally done in
Access 2, it must have some setting that makes it work different
in 2010.

Do you by chance have your A2010 database running with SQL ANSI 92
compatibility turned on?

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
The check boxes for both "This Database" and "Default for new databases" are
both cleared under the Object Designers.

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.