473,382 Members | 1,165 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,382 software developers and data experts.

Yet Another "OpenForm Action Cancelled" Topic

Hi, I've been having problems getting my forms to work correctly. If
seen other threads addressing this issue, however, these are not
working for me. The short of my problem is this. I am trying to open a
new form and initialize it with a db query based on the info in the
current form. This wasn't a problem until I changed the table's
primary key to an Autonumber. tblLockCore.lockId is the autonumber at
the source of the problem...

strQuery = "WorkstationID = '" & Workstation.Text & "' AND
tblLockCore.lockid = '" ....
[for loop that finds and appends *only one* value]
strQuery = strQuery & "'"
DoCmd.OpenForm "frmLockCore", , , strQuery

With the code above, I get the 'openform action cancelled' error. Keep
in mind there is no "Cancel = True" statement related to this code, nor
is there even a cancel button.

If I replace
tblLockCore.lockid = '...' with
tblLockCore.lockid - '...', the wrong record is used to initialize the
new form. Coincidentally it is always the first record that would be
found if the second clause was removed.

tblLockCore.lockid - ... (no quotes) *same as above*

tblLockCore.lockid = ... (no quotes) *same as above*

I believe that I have addressed the issues that I have seen work for
other people but apparently this is not good enough for my program. Any
ideas? Thanks in advance!

ps. a couple of links i had reviously read....
http://groups-beta.google.com/group/...bf46cd29f992ce

http://groups-beta.google.com/group/...730c533bc5ce63

Nov 13 '05 #1
2 1796
A typical case of the magical computer pixies... I leave the computer
for 3 hours and come back. I try all of the combos listed above and now
tblLockCore.lockid = ... (no quotes)

works. I know what you are thinking, "He wasnt thorough before and that
was his problem." Sadly, I was quite thorough trying each one several
times. But...

At least it works now.

Nov 13 '05 #2
Couple of suggestions, Jeff.

This type of intermittent issue could be caused by a Name AutoCorrect bug,
particularly as you indicate that it was triggered by a structural change.
Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
More info:
http://allenbrowne.com/bug-03.html

If that is not the issue, it could be that the code fails when strQuery is
malformed. For example, of Workstation was Null, strQuery would end up
something like this:
"WorkstationID = AND tblLocCore.lockid = 3"
which is clearly not going to work.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<je********@aol.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hi, I've been having problems getting my forms to work correctly. If
seen other threads addressing this issue, however, these are not
working for me. The short of my problem is this. I am trying to open a
new form and initialize it with a db query based on the info in the
current form. This wasn't a problem until I changed the table's
primary key to an Autonumber. tblLockCore.lockId is the autonumber at
the source of the problem...

strQuery = "WorkstationID = '" & Workstation.Text & "' AND
tblLockCore.lockid = '" ....
[for loop that finds and appends *only one* value]
strQuery = strQuery & "'"
DoCmd.OpenForm "frmLockCore", , , strQuery

With the code above, I get the 'openform action cancelled' error. Keep
in mind there is no "Cancel = True" statement related to this code, nor
is there even a cancel button.

If I replace
tblLockCore.lockid = '...' with
tblLockCore.lockid - '...', the wrong record is used to initialize the
new form. Coincidentally it is always the first record that would be
found if the second clause was removed.

tblLockCore.lockid - ... (no quotes) *same as above*

tblLockCore.lockid = ... (no quotes) *same as above*

I believe that I have addressed the issues that I have seen work for
other people but apparently this is not good enough for my program. Any
ideas? Thanks in advance!

ps. a couple of links i had reviously read....
http://groups-beta.google.com/group/...bf46cd29f992ce

http://groups-beta.google.com/group/...730c533bc5ce63

Nov 13 '05 #3

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

Similar topics

2
by: Sylvie Stone | last post by:
Hi group - I have an html form for that uses username and password to login to a specific area of the website. The "area" the user wants to go to is based on a pull down menu. Becasue the...
3
by: Zhidian Du | last post by:
I am using java to write to url, http://fatigo.bioinfo.cnio.es/ , but I found the form is : <form method="post" action="/" enctype="multipart/form-data" name="fatigo"> I have no idea why...
2
by: Don | last post by:
Can someone tell me what I'm doing wrong here. I can't believe I'm having this kind of problem. Think maybe I've been working on this for too long, and everything is starting to look the same. ...
1
by: tnhoe | last post by:
Hi, <Form method='post' action="next.htm?btn="+"this.myform.myobj.value"> What is the correct syntax for above ? Regards Hoe
1
by: unknown | last post by:
Can some one give me some "air code" to open a form in datasheet read only view. This... DoCmd.OpenForm "anyform", acNormal, acReadOnly ....will open my form and I can toggle back and forth...
1
by: RC | last post by:
If I want to explicitly save the record before executing a Close action. Which of the following should I use? Or does it depend on whether it is based on a Form or something else? If Me.Dirty...
0
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below)...
4
by: sid | last post by:
Can someone tell me how to detect "Action Cancelled" page with out polling. I have a frame set and I want to make sure the other frame is displaying what it is supposed to without polling. For...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.