data wont update

  • Thread starter Thread starter JimFC
  • Start date Start date
J

JimFC

Guest
Forgive me if this has been posted else where - but i am new to forums so ill try to pick it up quickly ok.

I gave an access 97 'menu' form called projects. When i click on the projects button, it opens up my projects form, and everything is fine and works ok.

On this projects form, I have a drop down showing all my contacts, so that i may select one to associate that person with that project on my projects form.

Here is the 64k question... if the contact is not in my drop down, i can click a button called edit, and it opens my contacts form where I can add a new contact. When I close the contacts form down, the projects form is now visible again. However my drop down menu does not show the new contact added. I even added a refresh button and still no joy.

Any suggestions - would be very much appreciated.

Jim.
 
JimFC said:
Here is the 64k question... if the contact is not in my drop down, i can click a button called edit, and it opens my contacts form where I can add a new contact. When I close the contacts form down, the projects form is now visible again. However my drop down menu does not show the new contact added. I even added a refresh button and still no joy.

Any suggestions - would be very much appreciated.

Jim.

Right so you have tried adding a me.refresh on the combo box, next have a look at where your combo box is pulling its data from and make just it is from the same table as your add/edit a contact is writting the data to.

If you need more help it maybe an idea to post you db and i can have a look for you.

Alastair
 
Code:
Me.MyCombo.Requery
 
Hmmm - i tried that - after you suggested it - but it did not work. The control is getting its data from the forms record source - you know how you click the empty space outside the form in design view, and look at record source, well the query is there.

Bu thanks anywaw :s
 
What is the code behind your refresh button? Is the combo box pulling data from a source other than the form's recordsource?
i.e...you can refresh/requery the form (the form's recordsource)...or you can requery the combo box (me.mycombobox.requery).
 
solution

I recently had this problem.

here is the code
Private Sub CustomerID_DblClick(cancel As Integer)
On Error GoTo err_CustomerID_dblclick
Dim lngCustomerID As Long

If IsNull(Me![CustomerID]) Then
Me![CustomerID].txt = ""
Else
lngCustomerID = Me![CustomerID]
Me![CustomerID] = Null
End If
DoCmd.OpenForm "Customers", , , , acAdd, acDialog, "gotonew"
Me![CustomerID].Requery
If lngCustomerID <> 0 Then Me![CustomerID] = lngCustomerID

exit_CustomerID_bdlclick:
Exit Sub

err_CustomerID_dblclick:
MsgBox Err.Description
Resume exit_CustomerID_bdlclick:
End Sub

not only will this update but it will also alow you to double click the customer field to add new customers.

NB you may have to change control names and objects as this has been copied straight from my project.

hope this helps. If not email me on ash77@aapt.net.au with more details and i will see if i can help.

Ash
 
Last edited:
Solution found - thread CLOSED

Solution found - thread CLOSED

Thanks for all your help

Jim
 
Jim,
It would be helpful to this Forum and those that tried to assist if you would take the time to explain your resolution.
 

Users who are viewing this thread

Back
Top Bottom