If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
'Add' not updating list box from combo box immediately on 1 of 2 f
I have 2 forms, each has a combo box from which the user makes a choice &
then presses the Add command button to enable this choice to appear in a list box on the form. On one form the choice appears in the list box as soon as the user presses Add but on the other form the choice doesn't appear immediately after pressing Add - you have to move to another record & then back again to get the choice to appear in the list box. I've compared the properties of the combo/list boxes & Add button as well as the underlying code & I can't find anything different between the forms that could be causing this anomaly (both forms use the same row source for the combo box, it's just that one form enables the 'choice' to be paired with one type of information & the other allows the 'choice' to be paired to different information). Please help! I've looked all over the forum & not been able to find anyone else with this problem. Thanks in advance Heidi |
#2
|
|||
|
|||
Have you tried Requery?
"Spydii" wrote: I have 2 forms, each has a combo box from which the user makes a choice & then presses the Add command button to enable this choice to appear in a list box on the form. On one form the choice appears in the list box as soon as the user presses Add but on the other form the choice doesn't appear immediately after pressing Add - you have to move to another record & then back again to get the choice to appear in the list box. I've compared the properties of the combo/list boxes & Add button as well as the underlying code & I can't find anything different between the forms that could be causing this anomaly (both forms use the same row source for the combo box, it's just that one form enables the 'choice' to be paired with one type of information & the other allows the 'choice' to be paired to different information). Please help! I've looked all over the forum & not been able to find anyone else with this problem. Thanks in advance Heidi |
#3
|
|||
|
|||
This is my first database & I'm learning as I go along so please excuse me if
I sound like I don't understand what I'm talking about! I use Requery in the code of both of the forms & in the same way but one updates immediately & the other doesn't hence why I am confused! I've pasted in the code below re. the Add Command button for both forms: The form below updates immediately: Private Sub Command56_Click() Dim MySet As Recordset Set MySet = CurrentDb().OpenRecordset("CourseModLink") MySet.AddNew MySet![Course] = [Course Title] MySet![Module Code] = Combo50 MySet.Update MySet.Close List52.Requery Combo50 = Null Combo50.Requery End Sub The form below requires me to move to another record & back for the 'choice' to appear in the List Box: Private Sub Command86_Click() Dim MySet As Recordset Set MySet = CurrentDb().OpenRecordset("EEModLink") MySet.AddNew MySet![External Examiner] = [External Examiner] MySet![Module Code] = Combo80 MySet.Update MySet.Close List82.Requery Combo80 = Null Combo80.Requery End Sub I'm hoping that being new to all this I'm just missing something really obvious! Heidi "hagen31" wrote: Have you tried Requery? "Spydii" wrote: I have 2 forms, each has a combo box from which the user makes a choice & then presses the Add command button to enable this choice to appear in a list box on the form. On one form the choice appears in the list box as soon as the user presses Add but on the other form the choice doesn't appear immediately after pressing Add - you have to move to another record & then back again to get the choice to appear in the list box. I've compared the properties of the combo/list boxes & Add button as well as the underlying code & I can't find anything different between the forms that could be causing this anomaly (both forms use the same row source for the combo box, it's just that one form enables the 'choice' to be paired with one type of information & the other allows the 'choice' to be paired to different information). Please help! I've looked all over the forum & not been able to find anyone else with this problem. Thanks in advance Heidi |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to modify the list in a combo box field ? | Dr Alok Modi MD | Using Forms | 3 | May 23rd, 2005 10:59 AM |
Combo Box | Dylan Moran | Using Forms | 7 | May 16th, 2005 02:25 AM |
Access combo box-show name, not ID, in table? | write on | New Users | 30 | April 30th, 2005 09:11 PM |
Limit combo box list only | Bruce | Using Forms | 4 | December 22nd, 2004 05:07 PM |
Restrict combo box value to list | sps | Using Forms | 0 | August 5th, 2004 01:52 PM |