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 / Forms / March 2008

Tip: Looking for answers? Try searching our database.

Re-posted: New Record after Filter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
g - 19 Mar 2008 17:49 GMT
Hello experts,

This is what i've used for my subform(FormSub) to interact with my treeview
control
on the Main Form(FormMain) of my database.

Forms!FormMain.FormSub.SourceObject = "Form1"
Forms!FormMain.FormSub.Form.Filter = "SPP = Forms!FormMain.USite"
Forms!FormMain.FormSub.Form.FilterOn = True

SPP = Table column associated in Form1
Forms!FormMain.Usite = Text box control on my FormMain

And it works perfectly fine. Now I need to know how to do to make it open
(The subform) always in a new record. As of now it always open on the first
record with filtered note at the record navigator.

I tried to add DoCmd.GotoRecord , , acNewRec after my code above but it
didn't
work. Also tried to put it in on open, active, load on the Form1 event to
experiment
but it didn't work as well.

I also tried to set Data Entry to YES on Form1 but didn't help. I know there
must be away & I'm hoping you know the answer.

Thank you in advance
g - 19 Mar 2008 19:13 GMT
I guess there is no answer for this. Thanks anyway

> Hello experts,
>
[quoted text clipped - 23 lines]
>
> Thank you in advance
BruceM - 19 Mar 2008 19:49 GMT
Be aware that this is a volunteer newsgroup.  Give it two days before you
repost.  You got impatient before two hours passed.

I don't know what you mean by "treeview control", but it sounds as if you
are filtering an unrelated subform recordset to correspond to the main
form's record when you should probably have a related table.  It's hard to
know since you haven't provided much information about the database
structure.  The subform control's Link Child and Link Master properties need
to be set to the linking field.  If you do it that way you won't need code,
and it will probably work better.

To open a recordset at a new record try:
Me.Recordset.AddNew
in the subform's Load event.  If you want to be at a new subform record each
time you move to a different main form record try:
Me.FormSub.Form.Recordset.AddNew
in the main form's Current event.

>I guess there is no answer for this. Thanks anyway
>
[quoted text clipped - 28 lines]
>>
>> Thank you in advance
g - 19 Mar 2008 20:55 GMT
To All:

My apology for being impatient. Not gonna happen again. Thank you Bruce for
notifying me for that, mymistake. To give you more details bout my database,
My Main  Form works as a dashboard & not bound to any tables. I used treeView
Control (TreeView shows the content of my menu)  instead of bottons at the
left side and an unbound subform at right side of the Main Form. If I click
one of the node of the treeView control the subform will call a function w/c
is the one I posted below. The records will be filtered & that works fine but
what I wanted to do is, after filterring the record the subform will go to a
new record automatically. Thanks again.

> Be aware that this is a volunteer newsgroup.  Give it two days before you
> repost.  You got impatient before two hours passed.
[quoted text clipped - 46 lines]
> >>
> >> Thank you in advance
g - 19 Mar 2008 21:01 GMT
Bruce, Thank you very much for your help. The
Me.FormSub.Form.Recordset.AddNew works exactly what I need.

Thanks

> To All:
>
[quoted text clipped - 58 lines]
> > >>
> > >> Thank you in advance
 
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.