473,725 Members | 2,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Thank you David Fenton... but one more little thing.

All,

I posted this earlier yesterday and thanks to David, for his
codes here. It kinds of work, but not always.

I have a MainForm with a subform. When I place the following
code in the Subform's On_Open, it only works for 1x (at open) when the
mainform is open with the subform. When I goto another record in the
main form, it quits working (i.e. not the most recent dated record is
on the top, however, I can browse the records within the subforms; it
says "You can't goto specified record")

=============== =============== *============== ==========
With Me.RecordsetClo ne
.FindFirst "[Date1]<=#" & Now() & "# AND [Date2]>#" & Now() & "#"
If .NoMatch Then
MsgBox "No records matched your criteria."
Else
If Me.Dirty Then Me.Dirty = False
Me.Bookmark = .Bookmark
End If
End With
=============== =============== *============== ===========

If I place the above codes in On_Current event, it works when I
go from records to records to display the current calender schedule in
the mainform, but I can not goto anther record within the subform!

What else event can I use? (I have tried them all, pretty much)
Or can the above code be modified to fit my situation? Please help.

P.S.: the mainform and the subform are linked by a Record#

Sincerely,
Perry

Nov 13 '05 #1
1 1289
pe******@yahoo. com wrote in
news:11******** **************@ g49g2000cwa.goo glegroups.com:
All,

I posted this earlier yesterday and thanks to David, for his
codes here. It kinds of work, but not always.

I have a MainForm with a subform. When I place the
following
code in the Subform's On_Open, it only works for 1x (at open) when
the mainform is open with the subform. When I goto another record
in the main form, it quits working (i.e. not the most recent dated
record is on the top, however, I can browse the records within the
subforms; it says "You can't goto specified record")

============== =============== =*============= ======
====
With Me.RecordsetClo ne
.FindFirst "[Date1]<=#" & Now() & "# AND [Date2]>#" & Now() &
"#"
If .NoMatch Then
MsgBox "No records matched your criteria."
Else
If Me.Dirty Then Me.Dirty = False
Me.Bookmark = .Bookmark
End If
End With
============== =============== =*============= ======
=====

If I place the above codes in On_Current event, it works
when I
go from records to records to display the current calender
schedule in the mainform, but I can not goto anther record within
the subform!

What else event can I use? (I have tried them all, pretty
much)
Or can the above code be modified to fit my situation? Please
help.

P.S.: the mainform and the subform are linked by a Record#


I've answered this question several times now. This is the last
time.

The code should be in the OnCurrent event of the parent form. It
will fire each time you move to a new record in the parent form, and
move to the records of the child form that match the dates in your
criteria.

However, your code is wrong for that. The OnCurrent of the parent
form should use a With block that refers to the child form's
RecordsetClone:

With Me!SubForm.Form .RecordsetClone
[the rest of the code remains unchanged, except]
Me!SubForm.Form .Bookmark = .Bookmark
End With

Again, if this doesn't answer your question or solve your problem,
then it's clearly a problem with your explanation -- so far as I am
able to understand what you're trying to accomplish, this is the
answer. But if I've not understood, it's probably not going to work.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
2558
by: Tony Toews | last post by:
Folks David Fenton does a fine job in helping folks in this newsgroup. I have learned from his postings and have enjoyed our discussions here. He belongs in this newsgroup more than many. Tony -- Tony Toews, Microsoft Access MVP Please respond only in the newsgroups so that others can
3
1477
by: Tess | last post by:
Okay. You asked for it. Here it is. Everything below the cutmark is pure, grade A, unadulterated David Fenton. Or see for yourself at: http://groups.google.com/groups?selm=69rlf8%2414u%241%40news.nyu edu&oe=UTF-8&output=gplain ================================ | The images of boys' bare butts stayed with me as fantasy material for
33
3154
by: Anthony England | last post by:
I am considering general error handling routines and have written a sample function to look up an ID in a table. The function returns True if it can find the ID and create a recordset based on that ID, otherwise it returns false. **I am not looking for comments on the usefulness of this function - it is only to demonstrate error handling** There are three versions of this code. David Fenton says under the earlier thread "DAO...
10
2289
by: Anthony England | last post by:
(sorry for the likely repost, but it is still not showing on my news server and after that much typing, I don't want to lose it) I am considering general error handling routines and have written a sample function to look up an ID in a table. The function returns True if it can find the ID and create a recordset based on that ID, otherwise it returns false. **I am not looking for comments on the usefulness of this function - it is
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.