473,698 Members | 2,023 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 1287
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
2554
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
1475
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
3147
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
2285
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
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
7725
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
6518
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
5860
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
4369
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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.