Hlp! Requery Cbo Not Working

Hello,

I'm using Access 2000.  I added a combo box to enable users to select an 
existing employee name.  The source of the form is a query that contains the 
last&", "&first to concatenate the two fields so they show correctly in the 
combo box.

Everything is fine until I add or delete an employee.  The combo box doesn't 
update automatically, so I added the following event in the form's After 
Update:

Private Sub Form_AfterUpdate()
Me!cboName.Requery
End Sub

However, now the combo and the employee records no longer are in synch.  
Nothing at all happens when I select an employee name.

I have tried a variety of requery events - form, combo box, both.... but 
they all result in this problem.

Any suggestions?

Thanks!
0
Utf
4/15/2010 10:11:01 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
720 Views

Similar Articles

[PageSpeed] 21

Joyce

When a user selects an employee name, how is that causing the form to 
display the selected employee?  Is there a procedure in the AfterUpdate 
event?

How many records are "in" the form?  Just one (the selected employee), or 
???

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

-- 
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Joyce" <Joyce@discussions.microsoft.com> wrote in message 
news:72A0C5A2-7AA6-49C2-B592-FA0D1BE4E051@microsoft.com...
> Hello,
>
> I'm using Access 2000.  I added a combo box to enable users to select an
> existing employee name.  The source of the form is a query that contains 
> the
> last&", "&first to concatenate the two fields so they show correctly in 
> the
> combo box.
>
> Everything is fine until I add or delete an employee.  The combo box 
> doesn't
> update automatically, so I added the following event in the form's After
> Update:
>
> Private Sub Form_AfterUpdate()
> Me!cboName.Requery
> End Sub
>
> However, now the combo and the employee records no longer are in synch.
> Nothing at all happens when I select an employee name.
>
> I have tried a variety of requery events - form, combo box, both.... but
> they all result in this problem.
>
> Any suggestions?
>
> Thanks! 


0
Jeff
4/15/2010 11:42:02 PM
Hi Jeff,

The form displays one employee record at a time Single Form default view.

I added an unbound Combo Box that allows the users to select an employee 
name.  The form is based on a query that contains first name, last name, a 
few other employee-related fields, plus an expression: Name: [LastName] & ", 
" & [FirstName] which I use to display employee last name and first name in 
the combo box.

When I am simply viewing the employees, everything works fine.  However, 
when I add a new record, or delete an existing record, the After Update Event 
Procedure as noted in my post, 

Private Sub Form_AfterUpdate()
Me!cboName.Requery
End Sub

it not only doesn't refresh the content of the combo box, but when I select 
an existing employee's name, it doesn't go to that employee.  It just keeps 
the currently added employee name (or first employee in the table) displayed.

I hope I've more clearly explained the problem.

Thanks so much.


"Jeff Boyce" wrote:

> Joyce
> 
> When a user selects an employee name, how is that causing the form to 
> display the selected employee?  Is there a procedure in the AfterUpdate 
> event?
> 
> How many records are "in" the form?  Just one (the selected employee), or 
> ???
> 
> More info, please...
> 
> Regards
> 
> Jeff Boyce
> Microsoft Access MVP
> 
> -- 
> Disclaimer: This author may have received products and services mentioned
> in this post. Mention and/or description of a product or service herein
> does not constitute endorsement thereof.
> 
> Any code or pseudocode included in this post is offered "as is", with no
> guarantee as to suitability.
> 
> You can thank the FTC of the USA for making this disclaimer
> possible/necessary.
> 
> "Joyce" <Joyce@discussions.microsoft.com> wrote in message 
> news:72A0C5A2-7AA6-49C2-B592-FA0D1BE4E051@microsoft.com...
> > Hello,
> >
> > I'm using Access 2000.  I added a combo box to enable users to select an
> > existing employee name.  The source of the form is a query that contains 
> > the
> > last&", "&first to concatenate the two fields so they show correctly in 
> > the
> > combo box.
> >
> > Everything is fine until I add or delete an employee.  The combo box 
> > doesn't
> > update automatically, so I added the following event in the form's After
> > Update:
> >
> > Private Sub Form_AfterUpdate()
> > Me!cboName.Requery
> > End Sub
> >
> > However, now the combo and the employee records no longer are in synch.
> > Nothing at all happens when I select an employee name.
> >
> > I have tried a variety of requery events - form, combo box, both.... but
> > they all result in this problem.
> >
> > Any suggestions?
> >
> > Thanks! 
> 
> 
> .
> 
0
Utf
4/16/2010 1:08:01 AM
Joyce

If I'm understanding, you aren't using the AfterUpdate of the combobox, but 
of the entire form.

I too use an unbound combobox to "select an employee", but use the 
combobox's AfterUpdate event to requery the form.  For the form itself, I 
feed it with a query that looks to the combobox for an ID.  ?Nobody 
selected?  Then the form display that (nothing) record.  ?Selected employee? 
Then the form displays THAT employee.

Good luck

Regards

Jeff Boyce
Microsoft Access MVP

-- 
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Joyce" <Joyce@discussions.microsoft.com> wrote in message 
news:12163DA0-B0BE-4C8C-A9B6-3AB1633A790E@microsoft.com...
> Hi Jeff,
>
> The form displays one employee record at a time Single Form default view.
>
> I added an unbound Combo Box that allows the users to select an employee
> name.  The form is based on a query that contains first name, last name, a
> few other employee-related fields, plus an expression: Name: [LastName] & 
> ",
> " & [FirstName] which I use to display employee last name and first name 
> in
> the combo box.
>
> When I am simply viewing the employees, everything works fine.  However,
> when I add a new record, or delete an existing record, the After Update 
> Event
> Procedure as noted in my post,
>
> Private Sub Form_AfterUpdate()
> Me!cboName.Requery
> End Sub
>
> it not only doesn't refresh the content of the combo box, but when I 
> select
> an existing employee's name, it doesn't go to that employee.  It just 
> keeps
> the currently added employee name (or first employee in the table) 
> displayed.
>
> I hope I've more clearly explained the problem.
>
> Thanks so much.
>
>
> "Jeff Boyce" wrote:
>
>> Joyce
>>
>> When a user selects an employee name, how is that causing the form to
>> display the selected employee?  Is there a procedure in the AfterUpdate
>> event?
>>
>> How many records are "in" the form?  Just one (the selected employee), or
>> ???
>>
>> More info, please...
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Access MVP
>>
>> -- 
>> Disclaimer: This author may have received products and services mentioned
>> in this post. Mention and/or description of a product or service herein
>> does not constitute endorsement thereof.
>>
>> Any code or pseudocode included in this post is offered "as is", with no
>> guarantee as to suitability.
>>
>> You can thank the FTC of the USA for making this disclaimer
>> possible/necessary.
>>
>> "Joyce" <Joyce@discussions.microsoft.com> wrote in message
>> news:72A0C5A2-7AA6-49C2-B592-FA0D1BE4E051@microsoft.com...
>> > Hello,
>> >
>> > I'm using Access 2000.  I added a combo box to enable users to select 
>> > an
>> > existing employee name.  The source of the form is a query that 
>> > contains
>> > the
>> > last&", "&first to concatenate the two fields so they show correctly in
>> > the
>> > combo box.
>> >
>> > Everything is fine until I add or delete an employee.  The combo box
>> > doesn't
>> > update automatically, so I added the following event in the form's 
>> > After
>> > Update:
>> >
>> > Private Sub Form_AfterUpdate()
>> > Me!cboName.Requery
>> > End Sub
>> >
>> > However, now the combo and the employee records no longer are in synch.
>> > Nothing at all happens when I select an employee name.
>> >
>> > I have tried a variety of requery events - form, combo box, both.... 
>> > but
>> > they all result in this problem.
>> >
>> > Any suggestions?
>> >
>> > Thanks!
>>
>>
>> .
>> 


0
Jeff
4/16/2010 10:21:51 PM
Reply:

Similar Artilces:

Referencing the Baseline Work field
All, I'm trying to create a calculated field that takes the contents of the Baseline Work field and multiply by the Physcial % Complete field. The formula is ([Baseline Work] * ([Physical % Complete]/100)). I get some screwball number, so to verify the contents of the Baseline Work field, I created a custom field (Baseline0Work) that just references that field, ([Baseline Work]). The number in the Baseline0Work field does not match what shows in the Baseline Work field. In fact, for one task, the Baseline Work field shows 6256 and the Baseline0Work field shows 375360. What's g...

CD key not working with upgrade
I was told that I needed to upgrade to 10.1.2 in order to fix the crash problem with OS 10.2.8. However, I can not get my CD key to work with the update. Only my husband's will work, with the obvious conflict since we are on a network---can't both have programs open. Can anyone help me with this? In article <7264c99b.0402202215.6ef58afe@posting.google.com>, blathermoore@yahoo.com (Michele) wrote: > I was told that I needed to upgrade to 10.1.2 in order to fix the > crash problem with OS 10.2.8. However, I can not get my CD key to work > with the update. Only my husba...

MSM 2002- Auto investment update of pref shares stopped working
I am using Money2002. Approx 3-4 weeks ago, the auto updates for all of my preferred share investments (on the TSX) stopped updating. The price column is blank, resulting in a market value of $nil. The auto update works fine for all of my common share investments (on the TSX). The same problem persists in other 'Money' files I have to monitor other investments. (ie. the preferred shares have stopped being updated automatically and the equity ones work fine). Therefore it is not a file specific issue. I can manually update the prices and the market value is calculated prop...

Best Work at Home Jobs Online
Are you looking for online jobs for college students? Or are you simply looking for the best work at home jobs online so that you don't have to work that boring 9 to five job any more? Well if you are you a college student who doesn't have time for a full time job but needs some extra cash and you're looking for online jobs from home or you're someone who simply needs a different line of work, then you've come to the right article! Today a lot of people are looking for online work and are getting into what is known as affiliate marketing. Why? Because it has a l...

Sync Center stopped working
Does anyone know a way to repair Mictosoft Sync Center in Vista Home Premium? I've never used it, and don't envision ever needing it, but I'm getting periodic alerts that it's stopped working The pop up during boot-up, and sometimes for no apparent reason that I can figure out. SFC /Scannow reveals no problems, and a Systems Restore would undo so much that it'd be more trouble than it's worth at this point. Failing a repair method, a way to either uninstall the blasted thing or just turn it off would be nice. Thanx: Buddha ...

Vista Screen Saver not working
Using Vista Premium. I have clicked on Preferences, gone to the Screen Saver menu, selected the folder, etc. I click on preview, and the screen saver works. But, after 15 minutes (which is what I have set it for), the Screen Saver does not come on - ever! Sorry Venusian, this is Mars. "venusian" wrote: > Using Vista Premium. I have clicked on Preferences, gone to the Screen Saver > menu, selected the folder, etc. I click on preview, and the screen saver > works. But, after 15 minutes (which is what I have set it for), the Screen > Saver does not come on - e...

Resource Usage Work Rollup
I am using a macro to consolidate multiple schedules into a single IMS. When the macro completed, I noticed about half the resources contained 0 hours in the summary work but contains work on their assigned tasks. MSP identified some resources as being overallocated even with 0 hrs. I am using MSP 2007 and Calculation = Automatic. Example: Named Resource 0 hrs (should equal 30) Task 1 10 hrs Task 2 20 hrs Any suggestions as to why some resources work fine but others don't...

Macro will not work
I have a macro which converts urls in a column to the words "Tax Record" but the macro will not work. I would appreicate any help I can get. The Marco is: Sub chngelink() ' ' chngelink Macro ' ' Keyboard Shortcut: Ctrl+z Sub ChangelinkT() Dim MyCol As String Dim MySht As String On Error Resume Next MyCol = InputBox("Enter column LETTER(S)") MySht = InputBox("Enter sheet name") Lastrow = Sheets(MySht).Cells(Cells.Rows.Count, MyCol).End(xlUp).Row For Each c In Sheets(MySht).Range(MyCol & "2:" & MyCol & Lastrow) ...

The code below worked for a few days and just totally stopped working. What can I do to make sure it continues to work? Thanks!
The code below worked for a few days and just totally stopped working. What can I do to make sure it continues to work? Thanks! ----- Private Sub Worksheet_Change(ByVal Target As Range) Dim C As Range, D As Range Set D = Intersect(Range("A:A"), Target) If D Is Nothing Then Exit Sub For Each C In D On Error Resume Next Target.Offset(0, 6).FormulaR1C1 = "=RC[-2]&RC[-5]" ' - For Column E Target.Offset(0, 7).FormulaR1C1 = "=RC[-2]&RC[-5]" ' - For Column F Target.Offset(0, 9).FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC7,I.O.! R2C1:R5...

NewBie, SQLAllocHandle only works on Win2003Server.
Hi, I just did a test, this code returns 1 on a windows2003 Server system, and my import works fine, however if I run this same code on a WinXP, Pro or XP Media it then returns 1 and the import does NOT work... Please any suggestions would be creatly appreciated.. where should I start looking.? retcode = 1 when running on Server 2003 retcode = 0 when running on WinXP Pro or WinXP Media SQLHENV henv = SQL_NULL_HENV; HDBC hdbc1 = SQL_NULL_HDBC; RETCODE retcode; SDWORD cRows; // Allocate the ODBC environment and save handle. retcode = SQLAllocHandle (SQL_HANDLE_ENV, SQL_NULL_HANDLE, &...

Layaway and partial payments
I recently ran into a snag with a customer picking up a partial layaway order. The customer placed 50% down on a layaway order. They came in and picked up part of the order that had been shipped to our store. When I recalled the layaway I went thru the following steps: 1. recall layaway>tender>pick up partial order>checked appropriate items. After going thru the steps the system required that the customer pay the remaining 50% of the ENTIRE order (instead of just the items they were picking up). Has anyone encountered this before? I do have it setup under the Store Operation man...

Short cuts & Dictionary not working in Outlook 2003...
Hi I am having a problem in my Outlook 2003. The problem is the auto dictionary is not working. i.e. it is not whowing underline (Red and Green) to any of the errors. Moreove the shortcuts like Shift+F7, CTL+Shift+> (for font size increment)and CTL+Shift+< (for font size reduction)are also not working. Though F7 is working. The problem started when i uninstalled my MS Word 2003 and installed Word 2000. The solve the problem i have tried to install the MS Word 2003 again. Still it was not working. So i have unstalled the whole Office and installed full office 2003. But still I am not ab...

How does "leave a copy" work?
Hello group. Outlook and Outlook Express both have a "leave a copy" feature, and I'm curious how they know which emails to download from the server, and which one not to download. Do they have a database somewhere in the disk for which they use to compare with the list of emails in the mail server or something? More precisely, I'm wondering why Outlook/OE sometimes loses this information somehow and redownloads everything again, and then I have to delete them since I already have them. -- Mvh / Best regards, Jack, Copenhagen The email address is for real :) Jack...

Help: SBS 2003 Exchange Send As permissions not working (and disappearing!)
Hello, I'm having a problem granting Send As rights to users. There's a particular company office manager who needs Send As access to several accounts. Unfortunately it's only worked for one of the accounts (an incoming "Jobs" box which is not logged into by anyone else). The other two accounts, no matter how many times I've tried, wont grant her permission to Send As. In fact I add her to the permissions list via Active Directory and a little later she's even disappeared from the list. I've messed with the 'This object' setting, and everything ...

Working with a worksheet that is not the active worksheet
How can I make this code work on my worksheet named February, when it is not the active worksheet? Sub BlankWeeks() ' ' Macro2 Macro ' ' If Range("C184").Value = "" Then Rows("184:228").Hidden = True End If If Range("C184").Value <> "" Then Rows("184:228").Hidden = False End If If Range("C229").Value = "" Then Rows("229:273").Hidden = True End If If Range("C229").Value <> "" The...

Add working hours to date field
We offer computer support based on a certain response time in hours. I want to have a date field, on the case form, to automatically set x WORKING hours ahead, usually 8 hours. The actually hour value will be pulled from a contract. Does anyone know if this is possible or am I shooting way too high? ...

Work Week View
Have Outlook 2002. I use the 5 day Work Week view to manage my appointments. Until this week I would see the 5 days on the left and on the right would be the monthly calendar and a tasks. The monthly calendars disappeared and left only the Task view. In an attempt to kick it in the pants I used the mouse and expanded the Work Week view and the Tasks disappeared and now I cannot get the Tasks back and the months are still gone. I really need the months to show, as that allowed me to navigate to different work weeks. If I can't get the calendar back is there a way to navigate ...

Calculating Time/Days worked
Hope you will bare with me while I explain. Once again I am working with a sheet, or series of sheets that hel employees calculate their time for days and hours worked. I decided against the protection button, as it was more of a proble with employees unchecking it. So, I am left with one last functio before it is complete. Let me remind you wonderful people I am new to excel and this is m first real project. Ok, my last 'function' I would like is this... Paydays are calculated from the 11th of each month to the 25th, the again from the 26th of each month to 10th of the the next month...

Why doesn't the Format Painter work for Excel chart titles?
Why doesn't the Format Painter work for Excel chart titles? When I highlight a chart title or axis title, the Format Painter remains grayed out. Without this utility, I don't know how to copy one chart title to another chart title without losing all the text formatting, which is extensive in my case (math symbols etc.) Thanks for any suggestions! ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the but...

I want work, and view,a single sheet in Mac Excel ... like I did in PC Excel
Operating System: Mac OS X 10.6 (Snow Leopard) How do you setup MAC Excel to be able to work in a single sheet format ... the Mac Excel comes up showing several sheets. It isn't showing "several sheets", it's using the newly introduced Page Layout View by default. You're only viewing the one sheet but it's 'separated' into pages as it would be if you were to print the sheet. You can click the Normal View button in the lower left corner of the document window or go to View> Normal to change the view of any given sheet at any time you wish � Norma...

how do I work out the VAT on a multpl of columns? #3
Grate!!!! - many thanks for all your help : -- chriss ----------------------------------------------------------------------- chrissy's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1584 View this thread: http://www.excelforum.com/showthread.php?threadid=27337 ...

"File: send to mail recipient" not working
When users (on WinXP) select file, "send to mail recipient", no response from Outlook 2002. This occurs either when Outlook is open or closed. Problem happens when rt. clicking on .doc, .xls, .pdf's....all files. Any ideas?? Thanks!! ...

Time interval at which MS CRM E-mail Router Service works
Hi, Can anyone please let me know the frequency (or time interval) at which Microsoft CRM E-mail Router Service works or processes requests from the mailbox? Thanks in advance and help appreciated. Bharat Chawla ...

Can Work thread get a windows class and manipulate it?
Suppose that I create a work thread when my dialog box started, then in the thread I get the pointer to the dialog mfc class and call updateData method. Does that work? I tried, but failed. Is there any other way to do? thanks!! No, it won't work, don't even waste time trying. It is almost guaranteed to fail. You do not manipulate the windows owned by one thread from a different thread. What you do is PostMessage requests from the worker thread to the main UI thread, usually to the window that contains the controls. The fact that you are using UpdateData already says you are in t...

Trim and Substitute not working
I have this excel with the following data in column A '1234567891234545 236556545454554554 '45454545455458475258 4845487845155484844 4848745125154545454 I want to do the following: 1) remove the extra space dat comes in the front of a few numbers. I've tried trim - it dint work. I've tried substitute - it dint work. I've tried text to column - dint work either. I've tried find and replace - it still dint work. Ok wat worked is this - I copied the space from the function bar, and then i did a find and replace of the copied space - it worked! ...