G
Guest
Hi,
I have a situation in which I need to be able to open a form and use it's
"return value" as the field in one of my queries. Iin other words, I would
like to be able to prompt the user for a particular value (but I'd prefer to
use my own form rather than an InputBox).
At first I wrote a function ScoreByHand that invoked DoCmd.OpenForm ... but
when it tried to call DoCmd.OpenForm I get run-time error '2486' "You can't
carry out this action at the present time."
The idea was to do something like:
SELECT userAnswer, correctAnswer,ScoreByHand(userAnswer, correctAnswer)
However, even when I do something like:
SELECT userAnswer, correctAnswer, InputBox("Score") ...
I get a "Function is not available in expressions"
I thought I might be able to work around the issue by opening the form
myself (without DoCmd). This is what I tried:
Dim frm As New [Form_Grade By Hand]
frm.Visible = True
Do While Not frm.Done
frm.Repaint
DoEvents
Loop
I thought I had done something like that in the past and had it work, but
this time, even though the window pops up, it never draws the control and I
get an "application not responding" when I click anywhere.
Any ideas on how to make this work????
You may wonder why I'm doing the query like this and I'll explain why upon
request, but so far it seems to be the best option if I can get it to work.
Thanks in advance!
I have a situation in which I need to be able to open a form and use it's
"return value" as the field in one of my queries. Iin other words, I would
like to be able to prompt the user for a particular value (but I'd prefer to
use my own form rather than an InputBox).
At first I wrote a function ScoreByHand that invoked DoCmd.OpenForm ... but
when it tried to call DoCmd.OpenForm I get run-time error '2486' "You can't
carry out this action at the present time."
The idea was to do something like:
SELECT userAnswer, correctAnswer,ScoreByHand(userAnswer, correctAnswer)
However, even when I do something like:
SELECT userAnswer, correctAnswer, InputBox("Score") ...
I get a "Function is not available in expressions"
I thought I might be able to work around the issue by opening the form
myself (without DoCmd). This is what I tried:
Dim frm As New [Form_Grade By Hand]
frm.Visible = True
Do While Not frm.Done
frm.Repaint
DoEvents
Loop
I thought I had done something like that in the past and had it work, but
this time, even though the window pops up, it never draws the control and I
get an "application not responding" when I click anywhere.
Any ideas on how to make this work????
You may wonder why I'm doing the query like this and I'll explain why upon
request, but so far it seems to be the best option if I can get it to work.
Thanks in advance!