473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Help w/ On Open Vs On_Open Vs On_Current

All,

I posted this earlier yesterday and here is more situation.
Thanks to David, by the way, 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)

================================================== ====
With Me.RecordsetClone
.FindFirst "[Date1]<=#" & Now() & "# AND [Date2]>#" & Now() & "#"
If .NoMatch Then
MsgBox "No records matched your criteria."
Else
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 browse the records 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 1538
You didn't say whether you used the On Current event in the main Form or the
On Current event in the Form embedded in the Subform Control. The latter
would fire every time you moved from one Record to another in the Subform.
The former would fire every time you move from one Record to another in the
main Form.

Larry Linson
Microsoft Access MVP

<pe******@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
All,

I posted this earlier yesterday and here is more situation.
Thanks to David, by the way, 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)

================================================== ====
With Me.RecordsetClone
.FindFirst "[Date1]<=#" & Now() & "# AND [Date2]>#" & Now() & "#"
If .NoMatch Then
MsgBox "No records matched your criteria."
Else
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 browse the records 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 #2

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

Similar topics

2
by: fabien | last post by:
Hi, I am writing a POV-RAY editor with Python using either QT or GTK as GUI 'wrapper'. ( I am still trying both ) * * * * PYGTK * * * * I have downloaded PygtkScintilla-1.99.5. There is a...
3
by: Abhas | last post by:
> > Hi, this is Abhas, > > I had made a video library program in C++, but was facing a problem. > > After entering 12 movies, i cannot enter any more movies. > > Something gibberish comes instead....
2
by: chanchito_cojones | last post by:
hi there, I am needing some help with a database I am putting together. The database works off of a main Form, which then has buttons on it that will open up other forms. The problem I am having...
4
by: CM | last post by:
Hi there: I have a web project which can be open and run without problem. I didn't open the web application for a period and during which I didn't modified any IIS items, but now I cannot open any...
1
by: bucrepus | last post by:
I know response.redirect doesn't open a new page. I have read many posts on how to fix this but I can't get the first one to work. Please help.. I have tried on 2 diff dev machines with no success...
13
by: Joner | last post by:
Hello, I'm having trouble with a little programme of mine where I connect to an access database. It seems to connect fine, and disconnect fine, but then after it won't reconnect, I get the error...
1
by: ipellew | last post by:
Hi; I open another browser window for help. It stays open untill I press help on my main web window again to close this help. If I "reload" the main window with this help page open in the...
6
by: priyajohal | last post by:
#include<fstream.h> #include<process.h> #include<stdlib.h> #include<conio.h> #include<string.h> #include<dos.h> #include<ctype.h> #include<stdio.h> void setup() void help();
2
by: ARC | last post by:
I have a ranking report where I want to sort it different ways depending on the option the user picks. On the On_Open event, I've tried everything I can think of and keep getting error 3071 "This...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.