date parameter causing textbox not to update

hey guys, here's a really queer but interesting problem.

here's my database. all reduced to just the 1 form 1 query and 2 tables.

here's how to reproduce the problem: open the database and then just press ok for lngReconciliationAccount  and dteValueDate parameter pop ups.

the form appears.

when i click on the unbound textbox on the left of "Command1", the onclick event changes the value to "text". but this is not shown.

if i were to click the "Command1" button, then the changes are shown for the textbox on the left. application.echo is set to true.

if i remove the dteValueDate parameter from the form's record source query, when i click on the textbox on the left of "Command1", the value is updated AND the change is shown.

why is this the case? this is really quite crazy ha. i was thinking form corruption but then the cause is the query not the form. and this form in the database is already a new form = )

help help guys! funny problem alert!! = )

i've decompiled and also C&Red the database
problem.mdb
developingprogrammerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Leigh PurvisDatabase DeveloperCommented:
At a guess, by just clicking past your parameter requests (not ideal by any means as I'm sure you know - form controls or functions rule ;-) then you're on a new record.  i.e. it's not been dirtied.
Looking at it, given that your form is read only (due to the query), the unbound control isn't updated with data until exiting - probably as a lazy display option.
A form with data or that isn't read only would surely behave as normally expected.
0
BitsqueezerCommented:
Hi,

after doing some tests with this issue I can say that it has nothing to do with your parameter query (not with the fact that it has parameters). The problem comes up in the case when a query (any) returns nothing, that means, EOF and BOF are true, and also the query is not updatable. In this combination you'll get that issue, I have no idea why Access does that.

If you have a query where the same happens but the query is updatable (so at least a new record can be entered) the issue doesn't come up.

The situation when a form is bound to a query which has no records and is not updatable always needs some extra tests as another issue is the "No current record" error message can appear in this case which doesn't happen if you normally have always data in your form.

Another issue with this is that in this case the detail section of the form will be cleared by Access. So if you have an unbound or any other control in there it will be invisible then, although it's Visible property is not set to False. I would say: This special situation is not really good designed by the MS developers and maybe you could also say, that's a bug of Access (your issue with the TextBox) because they sit in the footer and are unbound so normally this should work in any case.

Cheers,

Christian
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
developingprogrammerAuthor Commented:
thanks LPurvis for your help! seems like that's the case!!

thanks Christian for testing this out so much!! yup yup you got it!! i'm facing this "No Current Record" message with one of my forms - it's not mission critical cause that form will always have records, but just for the understanding and learning sake - how do i suppress this "No Current Record" pop up? thanks Christian!! = ))

thanks LPurvis too!
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

BitsqueezerCommented:
Hi,

the simplest method is: By checking that in the error handler and use Resume Next or Resume YourExitLabel (depending on your code) to simply surpress it.

Cheers,

Christian
0
developingprogrammerAuthor Commented:
hi Christian!

i put
            On Error Resume Next
            Forms(PreviousFormNameFromStack).Requery
            On Error GoTo 0

Open in new window

but it doesn't throw an error. after i requery everything is fine. and when i close then form then it tells me that "no current record". so weird!

and in my form i don't have an oncurrent event.

hrmm not mission critical but just a strange behaviour in Access.

so anyway to test and understand more i did this little experiment to try and reproduce the "no current record" error. here's the database attached. strange thing is that - when i add the 1st record to the table and press the command button on the form to requery, it's ok. but when i go to the table to delete the record so that there are no more records left, and then i press the button again, i don't get the "no current record" error message. when i close the form i don't get the message as well. hrmm how come my database is not reproducing the error Christian? thanks!!! = ))
Database1.zip
0
BitsqueezerCommented:
Hi,

you must do anything with the recordset. Try this:
Me.Recordset.MoveFirst

Open in new window

Cheers,

Christian
0
developingprogrammerAuthor Commented:
cool thanks Christian! i will try next week to force this error to occur so i can ignore it and the msgbox won't popup. let you know next week! = )
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.