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

No error warnings

P: 28
I have a situation that never occured in access 97 and Im really stuck as to where to find the solution, in the reports and forms I have set various variables, and control parameters via the coding area, I totally check that the form has to be completed, but as with some of the reports, if there is a problem, i.e. a control mentioned in the code that is not on the form, or if one of the controls is not activated my save button has no reaction at all and at times doesnt write the record at all. please help if u can - error checking is ticked fully in options. The save button simply checks the controls have been entered correctly and then closes, i open a new record to the table on current to the form.
Dec 1 '06 #1
Share this Question
Share on Google+
24 Replies


NeoPa
Expert Mod 15k+
P: 31,661
Can you post the code you have in the relevant Event procs.
I'm not sure what this is - it may be code related - but it's possible it's not Access related at all (maybe a glitch elsewhere). Try to explain clearly the circumstances under which the problem occurs too as this could also help.
Dec 2 '06 #2

P: 28
Thanks for your reply, at its simplist form i have a report that displays a field / control and in the code on format I check to see if the control is > 0, if not visible = false else visible = true, if I delete the control from the report design and try to run the report the screen simply flashes as if it tried to run but no response, as soon as i re-instate the control - all ok, im sure that 97 gave error messages if control did not exist.
Dec 2 '06 #3

P: 28
Just trying to sus this, I have these lines in code of report

Me![stabelheight].visible = True
Me![stableheight] = me![stable] + 30

as you can see spelling on 1st line incorrect - this gave no warnings or error, this type of error could take me an age to find if I have a lot of code

Any clues please
Dec 2 '06 #4

NeoPa
Expert Mod 15k+
P: 31,661
Do you run 'Compile {project name}' from the Debug menu when you're ready to test your code?
This should be found in a compile.
Otherwise I don't know what your problem may be.
Dec 3 '06 #5

P: 28
Yes, aplying comply action, I have also found that when I write a new record in a form and the table#1 im writing to has a relationship with another table (needs to be corresponding record value in table#2) then no error warning, just doesnt write the record.

I have tried just in table design and i get 'Cannot add or change a record because a related record is required in table#2'
Dec 3 '06 #6

NeoPa
Expert Mod 15k+
P: 31,661
It's a long shot, but try typing DoCmd.SetWarnings(True) in the immediate pane of the VBA window (Ctrl-G), then trying again to see if error message shows. If that doesn't change anything then I'm stumped.
Dec 3 '06 #7

P: 28
I really appreciate your patience with this problem, ive tried what you have suggested - no good - but again thanks for your efforts, I have reinstalled 2003 just in case, converted file to 97 and error appeared, but don't want to go back to 97 cuz of this. If you get any future solutions to this problem i will be gratefull and again thanks for your input.
Dec 3 '06 #8

P: 28
Thought I would let u know for future ref : opened new DB and inported all tables, queries, forms, reports and macros and error came back, must have been glich in current db, again thanks for your advise and support,
Dec 4 '06 #9

NeoPa
Expert Mod 15k+
P: 31,661
Thought I would let u know for future ref : opened new DB and imported all tables, queries, forms, reports and macros and error came back, must have been glich in current db, again thanks for your advise and support,
Did you mean the error came back or it's now solved?
Otherwise why assume glitch in the database... Just curious you understand.
Dec 4 '06 #10

P: 28
Expected error messages warned me of problem , the original DB was giving me no clues of errors - it seemed that error checking wasnt working, all solved now, thanks for your feedback - gud to know there are people willing to help - great forum.
Dec 5 '06 #11

NeoPa
Expert Mod 15k+
P: 31,661
Thank you.
Always nice to get feedback - positive feedback is best :).
This does sound like the problem I was trying to fix in post #7 though.
Did that not work for you? I was hoping it would allow more info from Access.
Dec 5 '06 #12

P: 28
#7 suggested typing DoCmd.SetWarnings(True) in the immediate pane of the VBA window, this didnt solve the fact that i didnt get any warning. just wondering if i spell a control name wrong in code ie i spell me![name] as me![namr] by mistake - should the compile find this, it doesnt when i try it but when i run the report then the wrongly spelled control is found (this was basically the type of problem i was experiencing) access was not warning me that i had typed a control wrong in the code.
Dec 5 '06 #13

NeoPa
Expert Mod 15k+
P: 31,661
Ahh.
Did you compile it (explicitly - Debug / Compile {project name}) or just try to run it after updating the code?
Dec 5 '06 #14

P: 28
I did it expicitly, the way i solved the problem was to create db1 and simply import 1 table and 1 report (the report with a control spelling mistake) and then tried to run and in new db1 i got expected error whereas in old db nothing - do you get a compile error if you compile {project name} when you have typed a control in wrong - im just curious you see.
Dec 5 '06 #15

NeoPa
Expert Mod 15k+
P: 31,661
Only if the compiler can determine what you're referring to.
If the code is in the form's module itself it can check.
Otherwise it can only check if you refer to the control using the format :
Form_{FormName}.{ControlName}
EG I have a form called frmMain with an exit command button on it called cmdExit.
That would be Form_frmMain.cmdExit.
If my code included Form_frmMain.cmdEcit then the compiler would find it.
If my code included Forms!frmMain.cmdEcit then the compiler would probably not find it.
Dec 6 '06 #16

P: 28
how about Me![formname]
Dec 6 '06 #17

NeoPa
Expert Mod 15k+
P: 31,661
how about Me![formname]
Me![formname] doesn't make sense.
Me.FormName is the name of the current form but [FormName] would have to be a variable of some sort with a value matching the name of a control or property of the form for Me![Formname] to work.
Dec 6 '06 #18

P: 28
Sorry my mistake i meant me![controlname], long day
Dec 6 '06 #19

NeoPa
Expert Mod 15k+
P: 31,661
Sorry my mistake I meant me![controlname], long day
You're not wrong there :)
The simplest way is to try it out, but I did that on my database and it complained at compile time.
I have 'Option Explicit' set which I think is critical.
Dec 7 '06 #20

MMcCarthy
Expert Mod 10K+
P: 14,534
Sorry my mistake i meant me![controlname], long day
To avoid the problem. Type Me. and wait for the list to drop down then select the appropriate control name. This will prevent spelling mistakes.

Mary
Dec 7 '06 #21

P: 28
Thanks - great tip, i wonder if you could identify the dirrerence between.

me!
me.
when do you need to bracket the control name [control]

when does forms!control or forms.control need to be used.

i get confused as to whether these are interchangable or is there a syntax for different situations, not really after answers to all - but maybe just a pointer to where there is an overview of the differences - if any.
Dec 7 '06 #22

NeoPa
Expert Mod 15k+
P: 31,661
The external syntax (code running from outside the form itself or one of its subforms) for this is :
Expand|Select|Wrap|Line Numbers
  1. Forms![FormName].[SubFormName].Form.[ControlName]
  2. or
  3. Forms("FormName").[SubFormName].Form.[ControlName]
Where :
FormName is the name of the main form.
SubFormName is the name of the Sub-form control on the main form in which the actual sub-form is contained.
ControlName is the name of the control that you want to refer to.

You will often see (!) used instead of (.). In most cases it's not a problem as Access will interpret it as a (.) if object it refines is not a collection.

Example to refer to a subform's txtJobNumber control :
Expand|Select|Wrap|Line Numbers
  1. Forms!frmFieldServiceDatabase.[qryReviewJobs subform].Form.txtJobNumber
  2. or
  3. Forms("frmFieldServiceDatabase").[qryReviewJobs subform].Form.txtJobNumber
[] are always acceptable indicators that you are referring to something by name. Field names; control names; etc.
They are necessary when the interpreter (either VBA compiler or SQL engine) would find the name ambiguous or invalid.
Embedded spaces or other non-standard characters are one reason. Reserved words are another.

Refernencing using (!) this is used as short-hand code for Parent("Name").
Expand|Select|Wrap|Line Numbers
  1. Forms("FormName")
  2. is equivalent to
  3. Forms!FormName
So instead of passing a string reference to a container object to identify the element required the name is included in the code itself.
Dec 7 '06 #23

P: 1
Can you post the code you have in the relevant Event procs.
I'm not sure what this is - it may be code related - but it's possible it's not Access related at all (maybe a glitch elsewhere). Try to explain clearly the circumstances under which the problem occurs too as this could also help.
when I exit out I get a box that says an error as occured and everything goes away and all I have is me desktop and icons. No home page or anything but this only happens when I x out
Jan 29 '07 #24

NeoPa
Expert Mod 15k+
P: 31,661
I'm really not sure where you're coming from.
Is this related to the current thread?
You quote my post (#2) but you don't provide the information requested therein.
Have no idea what you're looking for here :(
Jan 29 '07 #25

Post your reply

Sign in to post your reply or Sign up for a free account.