Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / February 2008

Tip: Looking for answers? Try searching our database.

Undefined Function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jlute@marzetti.com - 29 Feb 2008 17:51 GMT
Hi, there! I could use some help with a combo box. I'm trying to
populate it with another combo box and get the error: Undefined
Function. Here's the SQL for the combo box:

SELECT
FROM tblLocations
WHERE (((tblLocations.txtLocationID)=[cbCustomerName].Column(2)));

Do you see anything wrong with my code?

THANKS!
J_Goddard - 29 Feb 2008 18:45 GMT
Hi -

Select WHAT from tblLocations?  You need a field list after the SELECT.

John

>Hi, there! I could use some help with a combo box. I'm trying to
>populate it with another combo box and get the error: Undefined
[quoted text clipped - 7 lines]
>
>THANKS!

Signature

John Goddard
Ottawa, ON Canada
jrgoddard at cyberus dot ca

jlute@marzetti.com - 29 Feb 2008 19:12 GMT
On Feb 29, 1:45 pm, "J_Goddard via AccessMonster.com" <u37558@uwe>
wrote:

> Select WHAT from tblLocations?  You need a field list after the SELECT.

Hi, John. I cut the SQL down to be easier to read and didn't recognize
that that might throw things off:

SELECT qryLocIDsAddresses.txtLocID AS [Cust DC]
FROM tblLocations INNER JOIN (tblLocationsLocationIDs INNER JOIN
(tblLocationIDsAddresses INNER JOIN qryLocIDsAddresses ON
tblLocationIDsAddresses.numLocationAddressID =
qryLocIDsAddresses.numLocationAddressID) ON
tblLocationsLocationIDs.numLocID = tblLocationIDsAddresses.numLocID)
ON tblLocations.txtLocationID = tblLocationsLocationIDs.txtLocationID
GROUP BY qryLocIDsAddresses.txtLocID, tblLocations.txtLocationID
HAVING (((tblLocations.txtLocationID)=[cbCustomerName].Column(2)));

This works fine WITHOUT =[cbCustomerName].Column(2). The error
triggers when I add .Column(2).
J_Goddard - 29 Feb 2008 19:47 GMT
Hi -

How many columns are in the combo box [cbCustomerName]?  Did you remember
that .Column(2) refers to the *third* column?  

John

>On Feb 29, 1:45 pm, "J_Goddard via AccessMonster.com" <u37558@uwe>
>wrote:
[quoted text clipped - 16 lines]
>This works fine WITHOUT =[cbCustomerName].Column(2). The error
>triggers when I add .Column(2).

Signature

John Goddard
Ottawa, ON Canada
jrgoddard at cyberus dot ca

Chris - 29 Feb 2008 19:48 GMT
Try [cbCustomerName].Column(2,[cbCustomerName].ListIndex)

If that doesn't work, try
[cbCustomerName].Column(1,[cbCustomerName].ListIndex) since column numbering
actually begins with 0 and not 1.

> On Feb 29, 1:45 pm, "J_Goddard via AccessMonster.com" <u37558@uwe>
> wrote:
[quoted text clipped - 16 lines]
> This works fine WITHOUT =[cbCustomerName].Column(2). The error
> triggers when I add .Column(2).
Marshall Barton - 29 Feb 2008 19:49 GMT
>Hi, there! I could use some help with a combo box. I'm trying to
>populate it with another combo box and get the error: Undefined
[quoted text clipped - 3 lines]
>FROM tblLocations
>WHERE (((tblLocations.txtLocationID)=[cbCustomerName].Column(2)));

Queries do not recognize properties and methods that need
arguments in parenthesis.

I deal with this by adding a hidden text to the form and
using the first combo bex's AfterUpdate event to set the
text box's value before requerying the second combo box:
    Me.hiddentextbox = Me.cbCustomerName.Column(2)

Signature

Marsh
MVP [MS Access]

jlute@marzetti.com - 29 Feb 2008 21:38 GMT
> I deal with this by adding a hidden text to the form and
> using the first combo bex's AfterUpdate event to set the
> text box's value before requerying the second combo box:
>         Me.hiddentextbox = Me.cbCustomerName.Column(2)

Thanks, Marshall! I actually considered this but wanted to pursue the
other method. I tried Chris' suggestions below but they returned the
same error. Thanks, Chris!

Anyway, I've used the hidden control trick and it works BUT
[cbCustomerDC] isn't requerying off the hidden control [hidLocID]
despite having the proper After Update event in [hidLocID]. Basically,
[cbCustomerDC] queries accordingly ONLY when I open the form and make
a selection in [cbCustomerName]. When I make another selection in
[cbCustomerName] it properly updates [hidLocID] but [cbCustomerDC]
doesn't requery.

Any ideas why? BTW all of the controls are unbound.
jlute@marzetti.com - 29 Feb 2008 22:15 GMT
On Feb 29, 4:38 pm, jl...@marzetti.com wrote:

> > I deal with this by adding a hidden text to the form and
> > using the first combo bex's AfterUpdate event to set the
[quoted text clipped - 14 lines]
>
> Any ideas why? BTW all of the controls are unbound.

Whoops! I caught it. I forgot to add Me.cbCustomerDC.Requery to the
After Update Event of [cbCustomerName].

Thanks to everyone!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.