Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Conversion / April 2005

Tip: Looking for answers? Try searching our database.

DAO in Access 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
martin - 04 Oct 2004 13:16 GMT
I've created some DAO (including AddNew and Update),
attached to the NotInList event of a combo box in a
subform, to add a record to the table underlying the main
or parent form.  It works but the main form won't
refresh, behaving as if the new record isn't there until
I close the form and open it again.  I'm sure I've done
something like this before and am wondering if this is an
issue with v.2003.

Any ideas anyone?
Allen Browne - 04 Oct 2004 14:04 GMT
Did you remember to set the Response argument of the NotInList procedure to
acDataErrAdded?

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I've created some DAO (including AddNew and Update),
> attached to the NotInList event of a combo box in a
[quoted text clipped - 6 lines]
>
> Any ideas anyone?
- 05 Oct 2004 14:54 GMT
Yes I did - and the new record appears fine in the
combobox in the subform, just not in the main form which
doesn't seem to want to refresh.

>-----Original Message-----
>Did you remember to set the Response argument of the NotInList procedure to
[quoted text clipped - 12 lines]
>
>.
Allen Browne - 05 Oct 2004 15:32 GMT
You have the same set of records in the main form as in the subform? That's
unusual.

The main form has its own records, so you will need to Requery it so it
hears about the new record. That will cause it to reload, and so it goes
back to the first record. To work around that, you have to save the primary
key into a variable before the Requery, and then FindFirst in its
RecordsetClone to return to the desired record again.

There is probably a better solution than having the same records in both
forms (main and sub).

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Yes I did - and the new record appears fine in the
> combobox in the subform, just not in the main form which
[quoted text clipped - 21 lines]
>>>
>>> Any ideas anyone?
Martin - 06 Oct 2004 16:42 GMT
You were right - thanks very much for that.  (It's a
contacts database that's tracking who recommended whom:
the subform has a combobox listing the people in the
mainform so that I spell names correctly when I type them
but allows me to add new people from there as necessary.)

I used the subform's afterupdate event (the notinlist
event happens too early in the chain) and in fact didn't
need to use the recordsetclone or any DAO for this part:

Private Sub Form_AfterUpdate()
   Dim myCurrent As Variant
   myCurrent = Me.Parent.Bookmark
   Me.Parent.Requery
   Me.Parent.Bookmark = myCurrent
End Sub

>-----Original Message-----
>You have the same set of records in the main form as in the subform? That's
[quoted text clipped - 36 lines]
>
>.
cristina - 26 Nov 2004 10:40 GMT
hello, what your name??
martin <anonymous@discussions.microsoft.com> escribi? en el mensaje de
noticias 1b0001c4aa0b$f27347e0$a501280a@phx.gbl...
> I've created some DAO (including AddNew and Update),
> attached to the NotInList event of a combo box in a
[quoted text clipped - 6 lines]
>
> Any ideas anyone?
Raghavendra Hullur - 22 Apr 2005 10:55 GMT
Hi friend,
Can u send the code of ur project?
I am also having pagination problem,so that atleast I will come to know
what all I have to do.

Plz reply soon.

Thanx

Raghu
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.