By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,939 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,939 IT Pros & Developers. It's quick & easy.

2 Access XP/2002 Issues

P: n/a
Hi everyone,

My company recently upgraded from Office 97 to Office XP. As those
who've read my other posts know I have a database with 3 nested
subforms

Main form-->First Subform-->Second Subform

First subform is a subform of Main Form, and Second Subform is a
subform of First Subform.

My first issue is with a message box coded in the GotFocus event of a
control on Second Subform. It should only pop up when I click in this
control. Since the upgrade it's been popping up much more often -
when I click in other forms, from one form to another, or in other
controls on the First or Second Subforms. Our tech support person
defragged my computer and reminded me to empty my recycle bin and
delete cookies. He thought it was a delay in running the code because
of high volume on the disk and memory. Since this was done it doesn't
pop up nearly as much, but it still does when it's not supposed to.
I've been able to re-create this in one case: I click in the control
and the box pops up, click ok to close it, then click Save Record
button, which is on the main form. If I click in the first control of
the First Subform, the message pops up again even though it's not even
in the same form! I don't know how this is possible, unless Access is
randomly running bits of code. This never happened in Access 97.
Does anyone know what this bug is and how to fix it?

My second issue is with the Export function. I had set up a parameter
query to pull accounting data and export it to Excel. The procedure
was to run the query and with it open in datasheet view, export it to
Excel to be sent to Accounting. When I went to do this in Access XP,
the Export function wasn't available with the query open, it was
dimmed. I was upset because I had set up my users with shortcuts to
these queries and they needed to be able to export from an open query.
I found the export function could be used with the query closed, and
it still prompted for parameters, so I could still do the export.

About 10 days later I was getting ready to change my user procedures
when I tried it again and found the export function is now available
with the query open. I've checked every day this week and it has been
available every day. My question is, does the availability of the
export function from an open query come and go randomly? I need to
know so I can tell my users what to expect.

Thanks very much, any help on these things is appreciated.

Julia :-)
Nov 12 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
TC
It's really hard to see this happening.

Is this correct:

- The message in question only comes from a >single place< in the whole
database.

- That place is, the GotFocus event of a control on subform #2.

- The message sometimes appears when you click a control on subform #1.

- There is no code in subform #1 that displays that message.

- There is no code anywhere in subform #1 that calls an external procedure
or function (in any other form, subform or module) that could display that
message.

I know that subforms retain the concept of "current control", independent of
the main form &/or other subforms. So if you move the main form's focus to a
subform >control<, this possibly moves the >subform's< focus to the previous
"current control" of that subform. Perhaps that is something o do with it.

Post the code of your Enter event.

HTH,
TC


"Julia Baresch" <jb******@oldrepublic.com> wrote in message
news:50**************************@posting.google.c om...
Hi everyone,

My company recently upgraded from Office 97 to Office XP. As those
who've read my other posts know I have a database with 3 nested
subforms

Main form-->First Subform-->Second Subform

First subform is a subform of Main Form, and Second Subform is a
subform of First Subform.

My first issue is with a message box coded in the GotFocus event of a
control on Second Subform. It should only pop up when I click in this
control. Since the upgrade it's been popping up much more often -
when I click in other forms, from one form to another, or in other
controls on the First or Second Subforms. Our tech support person
defragged my computer and reminded me to empty my recycle bin and
delete cookies. He thought it was a delay in running the code because
of high volume on the disk and memory. Since this was done it doesn't
pop up nearly as much, but it still does when it's not supposed to.
I've been able to re-create this in one case: I click in the control
and the box pops up, click ok to close it, then click Save Record
button, which is on the main form. If I click in the first control of
the First Subform, the message pops up again even though it's not even
in the same form! I don't know how this is possible, unless Access is
randomly running bits of code. This never happened in Access 97.
Does anyone know what this bug is and how to fix it?

My second issue is with the Export function (snip)

Nov 12 '05 #2

P: n/a
"TC" <a@b.c.d> wrote in message news:<1070601772.258086@teuthos>...
It's really hard to see this happening.
Yes, isn't it!
Is this correct:

- The message in question only comes from a >single place< in the whole
database.
Yes
- That place is, the GotFocus event of a control on subform #2.
Yes, that's correct.
- The message sometimes appears when you click a control on subform #1.
Yes, or other controls on subform #2.
- There is no code in subform #1 that displays that message.
Right
- There is no code anywhere in subform #1 that calls an external procedure
or function (in any other form, subform or module) that could display that
message.
Right

It doesn't start popping up until I've clicked in the field once.
Then it pops up as it's supposed to, but after I close it and move on
to other fields and forms, it keeps popping up.
I know that subforms retain the concept of "current control", independent of
the main form &/or other subforms. So if you move the main form's focus to a
subform >control<, this possibly moves the >subform's< focus to the previous
"current control" of that subform. Perhaps that is something o do with it.
I'm going to research event order to check that out.
Post the code of your Enter event.
Do you mean the GotFocus event? Here it is:
---------------------------------------------------
Private Sub LetterNumber_GotFocus()

Dim LetterNumberMessage As String
Dim Title As String
Dim MyReturn

MyReturn = Chr(10)

LetterNumberMessage = "...Instructions for entering accounting
code..."

Title = "Letter Number Field"

If MsgBox(LetterNumberMessage, , Title) = vbOK Then

Exit Sub

End If

End Sub
------------------------------------------------------

Thanks very much!
Julia

Nov 12 '05 #3

P: n/a
TC
Ok, seems weird. Are you sure that this is actually your GotFocus event?
Private Sub LetterNumber_GotFocus()
Dim LetterNumberMessage As String
Dim Title As String
Dim MyReturn
MyReturn = Chr(10)
LetterNumberMessage = "...Instructions for entering accounting code..."
Title = "Letter Number Field"
If MsgBox(LetterNumberMessage, , Title) = vbOK Then
Exit Sub
End If
End Sub
If so, you could simplify the code, like this. (MyReturn seems not to be
used, and the if-check has no apparent purpose.)
Private Sub LetterNumber_GotFocus()
Dim LetterNumberMessage As String
Dim Title As String
LetterNumberMessage = "...Instructions for entering accounting code..."
Title = "Letter Number Field"
MsgBox LetterNumberMessage, , Title
End Sub
HTH,
TC
"Julia Baresch" <jb******@oldrepublic.com> wrote in message
news:50**************************@posting.google.c om... "TC" <a@b.c.d> wrote in message news:<1070601772.258086@teuthos>...
It's really hard to see this happening.
Yes, isn't it!

Is this correct:

- The message in question only comes from a >single place< in the whole
database.

Yes
- That place is, the GotFocus event of a control on subform #2.


Yes, that's correct.

- The message sometimes appears when you click a control on subform #1.


Yes, or other controls on subform #2.

- There is no code in subform #1 that displays that message.

Right
- There is no code anywhere in subform #1 that calls an external procedure or function (in any other form, subform or module) that could display that message.


Right

It doesn't start popping up until I've clicked in the field once.
Then it pops up as it's supposed to, but after I close it and move on
to other fields and forms, it keeps popping up.

I know that subforms retain the concept of "current control", independent of the main form &/or other subforms. So if you move the main form's focus to a subform >control<, this possibly moves the >subform's< focus to the previous "current control" of that subform. Perhaps that is something o do with

it.
I'm going to research event order to check that out.

Post the code of your Enter event.

Do you mean the GotFocus event? Here it is:
---------------------------------------------------
Private Sub LetterNumber_GotFocus()

Dim LetterNumberMessage As String
Dim Title As String
Dim MyReturn

MyReturn = Chr(10)

LetterNumberMessage = "...Instructions for entering accounting
code..."

Title = "Letter Number Field"

If MsgBox(LetterNumberMessage, , Title) = vbOK Then

Exit Sub

End If

End Sub
------------------------------------------------------

Thanks very much!
Julia

Nov 12 '05 #4

P: n/a
"TC" <a@b.c.d> wrote in message news:<1070688694.399965@teuthos>...
Ok, seems weird. Are you sure that this is actually your GotFocus event?
Well, it says it is... But is also shows in the code under Form
Properties, which might explain part of the problem. The changes I
made today in the Control Properties code show in the form code. I
don't know why. Is there a way to change this?
Private Sub LetterNumber_GotFocus()
Dim LetterNumberMessage As String
Dim Title As String
Dim MyReturn
MyReturn = Chr(10)
LetterNumberMessage = "...Instructions for entering accounting code..."
Title = "Letter Number Field"
If MsgBox(LetterNumberMessage, , Title) = vbOK Then
Exit Sub
End If
End Sub


If so, you could simplify the code, like this. (MyReturn seems not to be
used, and the if-check has no apparent purpose.)


MyReturn is used, there are 4 lines of instructions in the box. I
didn't include them for simplicity and confidentiality. When I was
coding this it took me a while to realize I had to assign the return
to a variable, that wasn't in the instructions.
Private Sub LetterNumber_GotFocus()
Dim LetterNumberMessage As String
Dim Title As String
LetterNumberMessage = "...Instructions for entering accounting code..."
Title = "Letter Number Field"
MsgBox LetterNumberMessage, , Title
End Sub


When I coded this in Access 97 the only way I could get it to work was
by making it an if-check. I tried the change you suggest and it
works, but it still pops up when it's not supposed to like before.

Also last week I tried moving the code to the Enter event of the
control, but this just made it worse: in addition to the other times
it also popped up when I used Find in the Main Form to go to a record.
This morning I put it back in GotFocus.

Thanks very much for your help so far. Let's keep trying - I don't
want to give in to an upgrade unless I have to!

Cheers,
Julia
Nov 12 '05 #5

P: n/a
TC
Hi Julia. I'm not sure where to go from here. You say you don't want to
"give in to an upgrade", but I don't think an upgrade will solve your
problem. It is almost certainly a coding problem. But without seeing the
code, it's hard to find the error from a distance. Do you have access to a
more experienced Access programmer who could check it out "on site"?

HTH,
TC
"Julia Baresch" <jb******@oldrepublic.com> wrote in message
news:50**************************@posting.google.c om...
"TC" <a@b.c.d> wrote in message news:<1070688694.399965@teuthos>...
Ok, seems weird. Are you sure that this is actually your GotFocus event?


Well, it says it is... But is also shows in the code under Form
Properties, which might explain part of the problem. The changes I
made today in the Control Properties code show in the form code. I
don't know why. Is there a way to change this?
Private Sub LetterNumber_GotFocus()
Dim LetterNumberMessage As String
Dim Title As String
Dim MyReturn
MyReturn = Chr(10)
LetterNumberMessage = "...Instructions for entering accounting code..." Title = "Letter Number Field"
If MsgBox(LetterNumberMessage, , Title) = vbOK Then
Exit Sub
End If
End Sub


If so, you could simplify the code, like this. (MyReturn seems not to be
used, and the if-check has no apparent purpose.)


MyReturn is used, there are 4 lines of instructions in the box. I
didn't include them for simplicity and confidentiality. When I was
coding this it took me a while to realize I had to assign the return
to a variable, that wasn't in the instructions.
Private Sub LetterNumber_GotFocus()
Dim LetterNumberMessage As String
Dim Title As String
LetterNumberMessage = "...Instructions for entering accounting code..." Title = "Letter Number Field"
MsgBox LetterNumberMessage, , Title
End Sub


When I coded this in Access 97 the only way I could get it to work was
by making it an if-check. I tried the change you suggest and it
works, but it still pops up when it's not supposed to like before.

Also last week I tried moving the code to the Enter event of the
control, but this just made it worse: in addition to the other times
it also popped up when I used Find in the Main Form to go to a record.
This morning I put it back in GotFocus.

Thanks very much for your help so far. Let's keep trying - I don't
want to give in to an upgrade unless I have to!

Cheers,
Julia

Nov 12 '05 #6

P: n/a
This all started with the upgrade to Office XP. It never happened
before in Access 97. Never! It's not the code that changed, it's the
version...... I guess I'll play around with the different events and
orders and see if I can make it work, but if not for the upgrade none
of this would be necessary. I might think of ways to work around it,
for example putting the instructions on a button instead, but I don't
want to change my program because of Microsoft's bugs. :p

Julia

"TC" <a@b.c.d> wrote in message news:<1070931915.965708@teuthos>...
Hi Julia. I'm not sure where to go from here. You say you don't want to
"give in to an upgrade", but I don't think an upgrade will solve your
problem. It is almost certainly a coding problem. But without seeing the
code, it's hard to find the error from a distance. Do you have access to a
more experienced Access programmer who could check it out "on site"?

HTH,
TC

Nov 12 '05 #7

P: n/a
TC
It's probably not a Microsoft bug. It's probably a coding error that
previous versions of Access handled differently to current version(s).
Otherwise, hundreds of other databases would not be working now, & thousands
of other people would be complaining of the same problem!

Cheers,
TC
"Julia Baresch" <jb******@oldrepublic.com> wrote in message
news:50**************************@posting.google.c om...
This all started with the upgrade to Office XP. It never happened
before in Access 97. Never! It's not the code that changed, it's the
version...... I guess I'll play around with the different events and
orders and see if I can make it work, but if not for the upgrade none
of this would be necessary. I might think of ways to work around it,
for example putting the instructions on a button instead, but I don't
want to change my program because of Microsoft's bugs. :p

Julia

"TC" <a@b.c.d> wrote in message news:<1070931915.965708@teuthos>...
Hi Julia. I'm not sure where to go from here. You say you don't want to
"give in to an upgrade", but I don't think an upgrade will solve your
problem. It is almost certainly a coding problem. But without seeing the
code, it's hard to find the error from a distance. Do you have access to a more experienced Access programmer who could check it out "on site"?

HTH,
TC

Nov 12 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.