New Record doesnt show

  • Thread starter Thread starter Xiphias
  • Start date Start date
X

Xiphias

Hi,

I have made 2 extra buttons next to the a drop box (thats setup for
navigation ).
1 button to edit and one to add new record. This happens in a 2nd form.
This works ok

Only when I close the 2nd form the drop box doesn't update. So I cant find
my new record.
I already tried with requery, but that makes no difference (or I'm doing
something wrong)
Most beautiful would be that the new added record would show when I close
the 2nd form.

And there is one other thing that I want to change, but I don't know how.
When I open my form the drop box is empty, but the rest of the for is
showing the first record.

Hope you have the time and patience to help me a little further.
Xiphias
 
Xiphias said:
Hi,

I have made 2 extra buttons next to the a drop box (thats setup for
navigation ).
1 button to edit and one to add new record. This happens in a 2nd
form. This works ok

Only when I close the 2nd form the drop box doesn't update. So I cant
find my new record.
I already tried with requery, but that makes no difference (or I'm
doing something wrong)
Most beautiful would be that the new added record would show when I
close the 2nd form.

And there is one other thing that I want to change, but I don't know
how. When I open my form the drop box is empty, but the rest of the
for is showing the first record.

Hope you have the time and patience to help me a little further.
Xiphias

Requery is the right method to use, but you're probably calling it too
soon. The simplest solution is to open the second form in dialog mode,
so all code on the first form pauses until the second form is closed or
hidden, then requery the first form afterward. The code would look
something like this (opening the form to add a new record):

DoCmd.OpenForm "SecondForm", _
DataMode:=acFormAdd, _
WindowMode:=acDialog

' Requery the combo box on this form to reflect the
' record we just added.
Me.cboFindRecord.Requery
 
Dirk,

Thank you very much!

Xiphias


Dirk Goldgar said:
Requery is the right method to use, but you're probably calling it too
soon. The simplest solution is to open the second form in dialog mode,
so all code on the first form pauses until the second form is closed or
hidden, then requery the first form afterward. The code would look
something like this (opening the form to add a new record):

DoCmd.OpenForm "SecondForm", _
DataMode:=acFormAdd, _
WindowMode:=acDialog

' Requery the combo box on this form to reflect the
' record we just added.
Me.cboFindRecord.Requery

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top