Cascading Combo Code Not Working

Can anyone help me with this?  I am using the following code for cascading 
combo boxes and I keep getting an "Undefined Function" error and the end of 
the "Where VendorCode" line is highlighted.

Private Sub VendorChoiceCombo_AfterUpdate()
    Me!ProcessChoiceCombo = Null

    If IsNull(VendorChoiceCombo) Then
        Me!VendorChoiceCombo.SetFocus
        Me!ProcessChoiceCombo.Enabled = False
    Else
        Me!ProcessChoiceCombo.Enabled = True
        Me!ProcessChoiceCombo.RowSource = 
ReplaceWhereClause(Me!ProcessChoiceCombo.RowSource, _
        "Where VendorCode = " & Me!VendorChoiceCombo)
        Me!ProcessChoiceCombo.Requery
    End If
End Sub

I am about to pull my hair out.  Any help would be greatly appreciated!

Thanks!
Shanna
0
Utf
11/17/2009 1:33:02 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

1 Replies
730 Views

Similar Articles

[PageSpeed] 38

Does the procedure

ReplaceWhereClause() actually exist, can you locate it in a module?
-- 
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"ShannaD" wrote:

> Can anyone help me with this?  I am using the following code for cascading 
> combo boxes and I keep getting an "Undefined Function" error and the end of 
> the "Where VendorCode" line is highlighted.
> 
> Private Sub VendorChoiceCombo_AfterUpdate()
>     Me!ProcessChoiceCombo = Null
> 
>     If IsNull(VendorChoiceCombo) Then
>         Me!VendorChoiceCombo.SetFocus
>         Me!ProcessChoiceCombo.Enabled = False
>     Else
>         Me!ProcessChoiceCombo.Enabled = True
>         Me!ProcessChoiceCombo.RowSource = 
> ReplaceWhereClause(Me!ProcessChoiceCombo.RowSource, _
>         "Where VendorCode = " & Me!VendorChoiceCombo)
>         Me!ProcessChoiceCombo.Requery
>     End If
> End Sub
> 
> I am about to pull my hair out.  Any help would be greatly appreciated!
> 
> Thanks!
> Shanna
0
Utf
11/17/2009 1:56:03 PM
Reply:

Similar Artilces:

SmartListBuilder: Linking not working properly. Bug?
We have a third-party customization added to GP. The table is in our company database and is accessible to add to GP. We can successfuly create a SmartList that queries only this table. However, when we link this table to another GP table, it doesn't work properly. I think I have isolated the problem. I found the SQL in the DEXSQL logs and the link, while seemingly correct in the SLB UI, is not generating the correct SQL code. See below for the actual SQLthat SLB generated. The last line is " T2. = T1.SOPTYPE and T2. = T1.SOPNUMBE" Note that the field name for T2. is m...

Max Limit for Values in List Boxes and Combo Boxes in Outlook forms
Folks, a user is setting up a form. She wants to have several combo boxes and list boxes with between 75 and 300 (yes, 300 -- that's not a typo!) possible values in the combo box or list box. Before she starts work on this, she would like to know if there is a limit on the number of possible values for a combo box or a multi-select list box. Is there a limit? Is it defined by the number of characters in the values box, or the number of actual values? What is the limit? Any help here would be appreciated. Thanks. David consulttech2004@hotmail.com ...

autocalculate doesn't work even with formula .
I have been using the same worksheet for past 1 year. Last week, when I edit the worksheet by input new data into it, I realise that : 1. The "Total" does not add up the sums of 2 cells automatically, even though the "A1 + B1" formulation is still in the cell. 2. I have auto-link sheet 1 cells into sheet 2 in different layout to suit my final output design. But even I paste the cells in the designated area in sheet 1, my final output does not automatically show the new data I have input into sheet 1. Only way to "show in the final output" correctl...

Find feature does not work with HTML messages (Content-type: text/html)
I have Outlook 2000 SP-3 running under Windows ME. When using the Find feature to locate all e-mails with a given word in the message, no items are found if the e-mails are of "text/html" content-type. The Find feature appears to work for any messages that have URLs embedded and are "multipart/alternative" or "text/plain" content-type. I noticed a similar post several months ago (see http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=%23qSBYIssDHA.2224%40TK2MSFTNGP09.phx.gbl). Is there a work-around for this problem, or should this be reported t...

VB code
Hello, I have sheet that I am wanting to enter Monday to Friday in cells manually. I want the Interior.ColorIndex to be ruled by the actual day that it currently is. I want to regulate that by today=() and format the value as dddd to give me the day. How do I write the code to tell it that I only want the Interior.ColorIndex to report the actual day? Hope that makes sense, Any help is appreciated. Andrew A bit more detail would be helpful -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "@Homeonthecouch" <me@home.com> wrote in message n...

Help with Combo-box
Hey everyone, hopefully someone's run across a problem similar to this and their is a (simple :) solution). Basically I have a simple combo-box that is displayed in a dialog. Now, the problem is that I have around 7200 entries that I want to appear in that box as valid selections...well thus far I haven't been able to get that many entries as a possibility (the combo-box simply refuses to allow me to enter that many fields of data). :( Okay, I tried googling this (thought maybe there was a readily defined maximum on combo-box data size) but I couldn't find anything that wou...

AutoFormat not working in Word 2007 in Windows 7
I have just installed the Office 2007 suite on Windows 7 Professional, 64-bit edition. Almost everything works well, but I noticed that when I type quotes, Word 2007 is not automatically converting them from straight quotes to curly quotes. I have went into the Word Options and tried the setting both ways, but it makes no difference. I have made absolutely no changes to this installation, and this problem does not occur on my Windows Vista and Windows XP machines. The computer is virus-free (I have an antivirus solution running, I don't go to shady sites to begin with...

pre-select new record in combo box
Hi, I have a form (frmActivity) with a combo box (cboStore) that gets its data from a table (Store). If there is a new store which dose not show in the combo box I have a command button on the same form that open a popup window for entering the name of the new store. In the 'on close' event of the popup I requeary the combo box (cboStore) on the main form so that the new store will appear. What I would really like is to have the new store already selected in the combo box when the popup is closed. Is this possible and if so how? Thanks, Phil Try after the requery of the ...

Barcode Code 128 checksum
I apologize if this is not the correct group for this question. I have been researching barcode technologies and I currently believe Code 128 best meets our needs. I need to encode a string of about of numbers, letters and special characters into a barcode. I am going to provide the data to our vendor and they will encode the barcode on our mailers. My question is about the checksum. Is there a standard list of values for Code 128 ? It looks like some of the vendors map out some of the characters to enhance their products. Where can I download the data required to generate and lookup th...

Code working but not straight away!
This code is selecting all my check boxes after I have to close the form and re-open, can it be altered to work without closing and opening the formThanks for any help...........BobPrivate Sub Command19_Click()Dim strsql As Stringstrsql = "UPDATE tblHorseInfo SET tblHorseInfo.Worksheet = True"DoCmd.RunSQL strsqlEnd Sub NEVER MIND fixed already...Thanks Bob"Bob" <xxx@xx.xx> wrote in message news:et7d5o$gmt$1@lust.ihug.co.nz...>> This code is selecting all my check boxes after I have to close the form > and re-open, can it be altered to work without closing and...

Code to send SMS text message?
Hi, I would like to send an SMS text message to a cel phone via code within Excel 2007. Has anyone done this? What code / services / products do I need to accomplish this? Does anyone have an example? Thanks in advance. --Dan What gateway are you using? What you would need to do is to snd a internet message to a gateway provider which would then send the messae out on the wireless land. Most likely you are using a webpage interface from your PC to interface with the gateway. So opening up an internet explorer and goiong to an URL is probably the method to use. ...

HR Reason Code and VBA
When changing pay code rates there is a dialog that pops up allowing the user to enter an effective date and reason code. Is there a way to get to this dialog box in VBA? This particular dialog does not seem to trigger BeforeModalDialog or AfterModalDialog. TIA, Jim That's because it's not a modal dialog. You know this because there is a drop list on it and modal dialog only have Yes/No/cancel, or OK or such. It might be modal however meaning that you have to use the hotkey to add it and the fields to vba. Control F-11 and Shift - F11 I believe - check your menu before the w...

Remote Desktop not working.
I cannot connect to remote desktop on a Windows 2003 Server with SP1. It is enabled but when I try i get the error: "The client could not connect to the remote computer. Remoote connections might not be enabled or the computer might be too busy to acccept new connections. It is also possible that network problems are preventing your connection. Please try connecting again later. If the problem continues to occur, contact your administrator." I have checked and there are not users connected. I have disabled remote desktop and enabled it again with no luck. The last cha...

Which 'event' to run pivot chart formatting code on file open?
Greetings I have code to change my pivot chart type to a mix of line and column also to refomat colours I need to run the code so that the user sees the changes when the file is opened Ive tried the 'workbook open' event and the chart activate event but noy joy so far. (Once the file is open, manualy triggering the code works perfectly) Any ideas? Thanks I don't know why workbook_open doesn't work. You could use Application.OnTime to run your code a short time (like 2 sec) after the workbook opens. - Jon ------- Jon Peltier, Peltier Technical Services, Inc. http://Peltier...

UDF Not working
This function should return the new string, but it returns Blank can anyone explain why, and also tell me how to fix it and avoid similar issues in the future. I tried using Select Case statement in my first attempt and it did not work, so I figure I switch to If statements, but the result is the same a blank. Thanks in advance Global strField As String Sub Raul() strField = "AP_Parts" strField = Test(strField) MsgBox (strField) End Sub Function Test(strField As String) As String Dim FndException strmval = UCase(strField) If strmval = &quo...

oPTION Group Coding
I have a macro, which will print all reports. I have a button in a option group assigned to this macro, which will print 10 reports. ( The other buttons, in the option group will print individual reports). I want to restrict user , because, sometimes, he may click it , when he does not want to print all reports. I want to know, how to give a message box, in an option group, a yes or no message box to restrict from printing. If he clicks yes, it should run the macro, if he click no, it should not print and come out. Please help.. In macro design view, show the Conditions column (if ...

How do I make the toolbar in my 'trial' of Publisher 2007 work?
nothing is active except the select all button. i can't edit or create anything. not making me want to buy the full version. thanks to anyone who has any ideas. j jives wrote: > nothing is active except the select all button. i can't edit or create > anything. not making me want to buy the full version. > thanks to anyone who has any ideas. > > j ======================= Maybe the tutorials at the following site will get you started: Publisher 2007 Creating a publication http://tinyurl.com/32ew4l -- John Inzer MS Picture It! - Digital Image MVP D...

Outlook connector doesn't work
vWin7 starter, Outlook 2003, Outlook connector v 14 installed. When klicking "Outlook connector" and "Add a new account" in Outlook, nothing happens (absolutely nothing - no messages or boxes appear). I habe removed and reinstalled both Outlook and Outlook connector several times, no help in that. Anyone who have a suggestion? ...

DIR function stopped working on Vista
Hi. I am developing an Access 2007 application on Windows Vista. Suddently the DIR() has function stopped working. By not working, I mean that the function constantly returns an empty string regardless if the specified file/directory argument exists. I recently installed some Vista updates from Microsoft Update...I wonder if this could have caused it. Does anyone know what could be causing this? Is anyone else experiencing this? Thanks Mike I have found that DIR will not work if you are using UNC paths to link to another file. Jeanette Cunningham MS Access MVP...

Combo Box and ListIndex problem
I have a combo Box that is connected to a table with two fields. The first field is a code and the second is the code description. I understand that if you set the listindex to 1; that refers to column one and so on. What I did was set the listindex to 0 (zero) which is what is being stored in a table which is meaningless. So the basic problem is that the value that is now stored in the table is a meaningless number which is the listindex value. I have changed the listindex value to one (1) and in the form where the combo box is used you can see the desired value, but the underlying tab...

Protected Mode not working??
Last week I was running IE7 and noticed that even though the "Enable Protected Mode" tick box under Tools > Internet Options > Security was properly checked the Status Bar at the bottom of the main screen said "Protected Mode: Off". So I installed IE8, but it still said the same. So I reset the security level to "Default" and re Set the tick box, clicked Apply, and restarted IE and the status bar still says the protected mode is off. What is going on here? What can I do about it. Ted Smith Vista SP1? You're logged in to the Adm...

clipboard copy doesn't work
(USING OFFICE XP: EXCEL) I have a string that is more than 255 characters long in Excel so it gets displayed as bunch of pound signs (#). That is ok, but when I select that cell and copy (Ctrl + C), all the pound signs get copied to the clipboard. It also writes out all the pound signs when i save the file in a text format (like .csv, comma-delimited). This is extremely irritating because it means I am going to have to write a macro to sift through the thousands of rows of my excel file and write out the values to a text file. I understand why you would want to display pound sig...

Find not working for numbers ending with zero
I am perplexed.. in Excel 2003 I can search my spreadsheet for number ending in a zero, such as 7457.80 and I can see the number on my screen but Excel will not find it. However, if I search for 7457 it will find the cell. To make it more confusing I can search for 1234.55 and it will find the cell containing 1234.55,, any nunber I search for endind with zero its unable to find, even though I am looking at the number... any suggestions? Thanks, Tony In math, there is no difference between: 1.2 and 1.20 and 1.200000000000000000 So search for 7457.8 If that numeric value is a constant, the...

Working around Passport Problem
Microsoft is still working the problem, but suggests this to handle things for now: (1) Type in username/password and select "I don't need to use online features that require Passport". (If you are not seeing this option, please try closing Money and reopening it. If that still does not allow the option to be shown, open Money with Start->Run and entering "msmoney -s" without the quotes into the box. (2) Click "sign-in" (3) Go to file -> password manager (4) On "File password settings" tab -> click change -> select "...

Outlook 2007 Keeps Crashing
Outlook 2007 keeps crashing and giving me the error message: Microsoft Outlook Stopped Working Problem signature: Problem Event Name: APPCRASH Application Name: OUTLOOK.EXE Application Version: 12.0.6514.5000 Application Timestamp: 4a89dc70 Fault Module Name: ntdll.dll Fault Module Version: 6.1.7600.16385 Fault Module Timestamp: 4a5bdadb Exception Code: c0000005 Exception Offset: 0002fc47 OS Version: 6.1.7600.2.0.0.256.48 Locale ID: 1033 Additional information about the problem: LCID: 1033 Brand: Office12Crash skulcid: 1033 Will Outlook run i...