473,573 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Next Record / Previous Record - what event occurs?

Greetings. I have a Mainform with a subform. The Mainform has single
record format and subform has continuous form format. When the Mainform
opens, I force allowadditions and allowedits to FALSE (for both the
Mainform and Subform). No problem there.

However, when I click on the navigation control of the subform to move
to the next record in the subform, the AllowAdditions and AllowEdits
changes to TRUE. Not good.

I set breakpoints at Form_KeyDown( ) and Form_KeyPress( ) in the
subform's module, to trace the problem, but neither breakpoint got hit.

QUESTION: What event occurs when the Navigation Control Next record or
Previous record are clicked?

Thanks much.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
15 11241
Susan Bricker wrote:
Greetings. I have a Mainform with a subform. The Mainform has single
record format and subform has continuous form format. When the
Mainform opens, I force allowadditions and allowedits to FALSE (for
both the Mainform and Subform). No problem there.

However, when I click on the navigation control of the subform to move
to the next record in the subform, the AllowAdditions and AllowEdits
changes to TRUE. Not good.

I set breakpoints at Form_KeyDown( ) and Form_KeyPress( ) in the
subform's module, to trace the problem, but neither breakpoint got
hit.

QUESTION: What event occurs when the Navigation Control Next record or
Previous record are clicked?


Current event of the form, and it would not change your AllowAdditions and
AllowEdits settings unless it contained code to explicitly do so.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
Rick,

Thanks for the info. I did hit CurrentEvent of the subform. However,
somehow those properties are changing. I have traced it around 10 times
now and it doesn't seem to go anywhere after the end of the Form_Current
routine (in the Subform). I have tried setting a "Watch" entry to see
when the value of the property changes, but I may not be setting the
Watch up properly because I don't get any hits on that, either.

Wow, this is a toughy.

I'd gladly send my mdb file (zipped) to anyone who would be interested
in helping. Just send an email address. Thank you, again, for trying
to help.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3
rkc
Susan Bricker wrote:
Thanks for the info. I did hit CurrentEvent of the subform. However,
somehow those properties are changing. I have traced it around 10 times
now and it doesn't seem to go anywhere after the end of the Form_Current
routine (in the Subform). I have tried setting a "Watch" entry to see
when the value of the property changes, but I may not be setting the
Watch up properly because I don't get any hits on that, either.


Try setting break points at each line in your code that changes
the allowadditions and allowedits properties. That's as simple as
clicking in the left hand margin at the start of the line. You can
then put your cursor over any variable, in any procedure, that hasn't
gone out of scope to see it's value.
Nov 13 '05 #4
I am so stuck on this one. A large icecream sundae to someone who can
help me (ok ... I can't really do that ... but if I could I would).

I have tried resetting the AllowAdditions and AllowEdits properties of
the subform to FALSE in the OnCurrent and AfterUpdate events. That
didn't work. I was still able to update the data in the subform after
moving to the next record with the Navigation Control. I have tried
setting Cancel to TRUE in the BeforeUpdate event of the subform. That
was no good because that canceled the 'move to next record' event (no
good).

Problem: I have the Main Form and Subform with AllowAdditions and
AllowEdits set to FALSE. I move to the next record in the Subform and
then try to change data in the subform and even though I expect to be
prevented, I can make the change. UGHHH!!!

I know that someone said that I must be explicitly changeing the
properties, but I just don't see it. I'll gladly send my mdb file to
someone to debug for me.

HELP!!!! I really need to get past this problem, quickly.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #5
Susan Bricker wrote:
[snip]
Problem: I have the Main Form and Subform with AllowAdditions and
AllowEdits set to FALSE. I move to the next record in the Subform and
then try to change data in the subform and even though I expect to be
prevented, I can make the change. UGHHH!!!

I know that someone said that I must be explicitly changeing the
properties, but I just don't see it. I'll gladly send my mdb file to
someone to debug for me.[snip]


Is there *any* code in the current event of the subform? If so post it.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #6
Rick,

Hi. Here's the Form_Current( ) and Form_Load( ) routines from the
subform sfrmTrialInfo:

More Info:
Mainform = frmEvents (based on tblEvents)
Subform control = subfrmTI
Subform name = sfrmTrialInfo (based on tblTrials)
In sfrmTrialInfo:
Subform control = subfrmTCI
Subform name = sfrmTrialClass (based on TblTrialClass)

Relationships:
Events->Trials (1 to many)
Trials->Classes (1 to many)

*============== =============== =======*

Private Sub Form_Current()
On Error GoTo Err_Form_Curren t

Dim intCount As Integer
Dim db As DAO.Database
Dim rsT As DAO.Recordset
Dim strSQL As String
If blnYesRecords Then 'If there are TRIAL RECORDS then do the
following
If strMode = "BROWSE" Or strMode = "UNKNOWN" Then
'Find out if there are any records in tblTrialClass for this
Trial
intCount = DCount("[trialclassID]", _
"tblTrialClass" , _
"[trialID] = " & Me![trialID])
If intCount = 0 Then
' Display message that says there are no Classes for
this Trial
Me![lblNoClassRecs].Visible = True
Me![subfrmTCI].Visible = False
Else
Me![lblNoClassRecs].Visible = False
Me![subfrmTCI].Visible = True
End If
Me![cboTrialRep] = Me![repID]
End If ' End of BROWSE/UNKNOWN Mode

'Me![cboTrialRep] = Me![repID]
End If ' End of YES TRIAL RECORDS EXIST
Exit_Form_Curre nt:
Exit Sub

Err_Form_Curren t:
Call ShowError("sfrm TrialInfo", "Form_Curre nt", Err.Number,
Err.Description )
Resume Exit_Form_Curre nt
End Sub

*============== =============== ======*

Private Sub Form_Load()
'Find out if we have any Trial Records
If Me.RecordsetClo ne.EOF Then
blnYesRecords = False
Else
blnYesRecords = True
End If
End Sub
*============== =============== ======*

In the Form_Current( ) routine, the variable strMode is, indeed,
"BROWSE" (setup in previous form). It's a global variable defined in a
CommonProcs module that I have for common routines.

Thanks.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #7
I like icecream ....

What version of Access ?
If your mdb-version <= Acc2000 then you may send it and I will have a look...
(Remove the obvious from my email-address)

Arno R

"Susan Bricker" <sl*****@verizo n.net> schreef in bericht news:29******** *****@news.uswe st.net...
I am so stuck on this one. A large icecream sundae to someone who can
help me (ok ... I can't really do that ... but if I could I would).

I have tried resetting the AllowAdditions and AllowEdits properties of
the subform to FALSE in the OnCurrent and AfterUpdate events. That
didn't work. I was still able to update the data in the subform after
moving to the next record with the Navigation Control. I have tried
setting Cancel to TRUE in the BeforeUpdate event of the subform. That
was no good because that canceled the 'move to next record' event (no
good).

Problem: I have the Main Form and Subform with AllowAdditions and
AllowEdits set to FALSE. I move to the next record in the Subform and
then try to change data in the subform and even though I expect to be
prevented, I can make the change. UGHHH!!!

I know that someone said that I must be explicitly changeing the
properties, but I just don't see it. I'll gladly send my mdb file to
someone to debug for me.

HELP!!!! I really need to get past this problem, quickly.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***

Nov 13 '05 #8
Arno,

I'm using Access 2k. Thanks for the offer of help. However, I don't
see your email address in your post or in the post header. Where is it?

SueB
Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #9
Susan,
You must be able to see it in the header ...
It says: ar***********@t iscali.nl there, or don't you see that where you post from ??

Arno R

"Susan Bricker" <sl*****@verizo n.net> schreef in bericht news:Yg******** *****@news.uswe st.net...
Arno,

I'm using Access 2k. Thanks for the offer of help. However, I don't
see your email address in your post or in the post header. Where is it?

SueB
Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***

Nov 13 '05 #10

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

Similar topics

5
12477
by: Rick | last post by:
I am moving throught a set of records, my next works great but previous move to the first record. Also what is the best way to check and see if it is the first or last record in the set. if($move == "Next") { $next_rec = "select * from people where contactid > $rec_id limit 1"; $results = mysql_query($next_rec); $row =...
5
9460
by: Bob Bedford | last post by:
Does exist a next prev function in PHP/Mysql. I've a website with returns lot of records (say about 200). The user may browse trough the list or returned records, but he has to click the record result then click back's browser in order to see the next record. I'd like to provide a "see next" and "see previous" record in the details itself. How...
1
2214
by: ubmc | last post by:
Revised form layout by dragging/dropping fields from field list and deleting unwanted fields. However, unable to go to next existing record or return to previous existing record, but can add new record. Error message received when attempting to go to next or previous existing record: "The value you entered isn't valid for this field."
9
6727
by: Karl Roes | last post by:
Hi All, I would like some advice on Next / Previous record buttons. I have a main form for the client, and a continuous subform listing client transactions. If I open one of these transactions ( dblclick ) in say 'frmtransaction', I would like to scroll forward and backward through the transactions as they appear on the continuous subform...
0
1192
by: David C | last post by:
I am gathering some ideas. Just like after you open up an email, on the screen are the previous and next buttons. You can navigation to the next or previous record. So how would you maintain the list of records and know what the next and previous record is to navigation to? I would like to know how you have implemented this with the...
8
3156
by: Jeff | last post by:
A client wants a press of the Enter key in a field on a continuous form to grab the value of that field from the previous record. But if they have typed a value and then hit Enter it shouldn't. I have tried a few ways but the main problem is that after typing a value and hitting Enter it still grabs the value from the previous record,...
1
4329
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same logic for a date field. i.e. theValue.defaultvalue = "#" & theValue.value & "#" I can't get this to work for some reason and I can't figure out...
16
6519
by: zoeb | last post by:
Hi, I am a complete novice to Access VBA and looking for some help to select a record. I am looking to perform an operation on the previous record - i.e. adding a new blank field, and then calculating the value in the new field by increasing the value in the previous record by a percentage. However, I am unsure of how to select the previous...
3
3091
by: bhupesh8525 | last post by:
please help me thank to you in advance
0
7679
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...
0
8191
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...
1
7760
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6392
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...
0
5284
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...
0
3724
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...
0
3723
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2185
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
0
1029
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...

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.