Error 3163

R

Roy Tong

I have amended a form and now get the 3163 error message on the
following statement:

Me.DateProjectRegistered = Date

.....just about the first instruction within the form load event

The DateProjectRegistered field is a Long Date field and hasn't changed
so this error message is clearly wrong - I am not trying to paste too
much data.

Is there any other sort of error I could have made which might have
caused this failure?

I have tried compacting the database and this worked OK and didn't
throw up any evidence of corruption.

I am on v'97

Thanks,

Roy
 
A

Allen Browne

Roy, chances are that you have something else named Date, so the code is
attempting to assign the wrong thing. It could be a control, variable,
function, sub, type, enum, module, or even the project itself.

To test that idea, try:
Me.DateProjectRegistered = VBA.Date
If that works okay, you have some searching to do. You might be able to
track it by removing the VBA again, placing the cursor in the Date word, and
pressing Shift+F2 (though that only works for some kinds of things.)

If the VBA.Date still gives the same error, open your table in design view.
What is the Data Type of DateProjectRegistered? Is it a Date/Time type
field, or a Text field?

It should not matter what Format you use for the date: internally, Access
stores dates as fractional numbers.

In general, assigning a value to a bound control in the Load event of a form
makes no sense. You don't want to alter the value of a field just because
the form happened to open with that record first. The record that gets
changed would depend on how the form is filtered, sorted, the edit mode,
etc.
 
R

Roy Tong

Allen,

Thanks for the prompt response. I tried VBA.Date but the problem still
recurred. I take your point about setting field values at form load -
this is code that I inherited and in this case it's a field that once
set, should never change. I commented out this line of code and
everything seems to work OK - on my new PC - more about that in a
moment. I think this problem is a symptom of something more serious.

I've proved that the failure wasn't directly related to my changes to
this form - when I reinstated the old form, the problem still occurred.
I've a feeling that this problem is related to an incompatibility
between my old PC (Office '98 & Access '97) and my new PC (Office 2003
& Access'97).

The reason I've got two PCs is that I wanted to check out some
incompatibility failures I have been seeing recently. This is a shared
database. Two of my colleagues recently got upgrades to Office 2003 and
long standing simple queries suddenly started failing. With reference
to this website I found that if I go into design on any module, then
click Tools, References, then tick a reference box, come out, go back
in and then untick it again, it sorts the problem out. Only temporarily
because then it doesn't work on the old version and if I repeat this
fix on the old version the new one fails etc... You may be familiar
with this problem.

I have taken a development copy of my database that I've been working
on for two weeks. It worked OK on both old and new PCs until today. The
old version now won't even start up - I get a message - "Can't find
project or library" in the initial startup routine, which I haven't
changed at all. The new version works OK now that I've commented out
that line of code which was nowhere near the start up routine that is
now failing.

I'm not expecting you to resolve all my problems via email like this
but if there's any general guidance you or anyone else can give on
sharing a database across different versions of MS Office (bearing in
mind both are Access '97) I''d be grateful. I get the impression that I
shouldn't be attempting to do this - is it bad practice?

Regards,

Roy
 
A

Allen Browne

Okay, several issues here.

Firstly, when you move a database from Win98 to WinXP, there can be issues
with references (both locations and versions.) You might solve it by
unchecking the reference, decompiling, compacting the database,
unregistering the library, re-registering the library, selecting the library
again, and compiling all. More info on references:
http://allenbrowne.com/ser-38.html

Regarding versions, if you try to open an A97 mdb in A2003, you get a dialog
with 2 options: convert, or open. "Convert" makes a new mdb in a later file
format, which A97 can't use. "Open" allows you to use the A97 mdb in A2003,
but not to make any design changes to it. Using Open does affect the file,
so it can have unintended side effects. Convert is a much better option. If
you really have to use the database in both versions, the best solution is
to split it, retain the A97 back end, and Convert the A97 front end to A2000
or 2002/3 format. The A97 machines can then use the A97 front end, and the
A2003 machines can use the front end for their own version.

If you have "opened" the A97 mdb in A2003, you might solve the issue by
creating a new (blank) A97 mdb, and importing everything (File | Get
External.) Combined with a decompile, that might stabilize things.

There are some other reasons why the queries may not work in the later
version of JET. There are differences in the way JET 4 handles types, and in
the way it refers to objects (particularly subforms.) Typecasting calculated
fields and declaring parameters might help. More on that:
http://allenbrowne.com/ser-45.html

Conversion to a later file format can be painless, but for suggestions on
the kinds of issues you might encounter, see:
Converting from Access 97 to 2000 and later
at:
http://allenbrowne.com/ser-48.html

BTW, lots of us run multiple versions of Access on the one computer. The
computer I'm posting this from has A97, 2000, 2002, and 2003 all installed,
and I plan to add the new A2007 shortly.

HTH
 
R

Roy Tong

Thanks for such a comprehensive reply regarding the compatibility
issues. I'll look into this using the info you've given me.

Regarding my original 3163 problem, I have just noticed this occurs
even if I open the table directly and try to enter a new record at the
end. No matter which field I start to enter data in, perhaps only 1
character, I get a 3163 message telling me that I'm trying to enter too
much data. I can amend data in existing fields in existing records but
the minute I try entering any data in a new record I get a 3163.

This looked like a corruption problem but I tried doing a repair and it
made no difference. Has anyone seen this type of problem before?

Roy
 
A

Allen Browne

Open the table in design view.
Is there anything that refers to Date?

The Default Value property of one of the fields would be a likely candidate
since it applies to new records. Could also be in a Validation Rule. Or
perhaps an invalid format or input mask.

Do any of the fields in the table have their Lookup set to Combo? Does
changing this back to TextBox solve the problem? (It could if the RowSource
was invalid, or there was a problem with the way the data is connected.)

If that does not pin down the issue, how many fields do you have in this
table?

Another idea: select the table in the Database Window.
Copy (Ctrl+C) and paste (Ctrl+V), choosing "Structure Only" in the dialog.
Are you able to add a new record to this copy of the table?

You could run this utility over the database and see if it identifies any
problem names:
Database Issue Checker
at:
http://allenbrowne.com/AppIssueChecker.html
 
R

Roy Tong

Thanks, that's cracked it. I had a new field of 20 chars and I'd set
the default value to 21 chars. Should have realised, but I'll know what
to look for next time.

Thanks again for your help.

Roy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Error Message 3163 2
Error 3163 2
3163 Field is too small 2
Error '3163' 1
Union Query & Error 3163 2
ERROR #3163 1
Error when entering data 1
Run-time error 3163 2

Top