Microsoft Jet Database error/message

T

Ted

woops, i just reminded myself that the Lastedited field remains to be solved
for (needed to have the system autogenerate the DAteTime....

Dirk Goldgar said:
Ted said:
here's the contents of the immediate window's:

INSERT INTO [DaysView] ([Last Name], [First Name], [MI],[MR_Number],
[IRB Number], [RecordNumber], [Updated_By]) SELECT "Adams" AS LN,
"Mary" AS FN, "--" AS MI, 1234567 AS MR, "04-04-083" AS IRB, 10 AS
VIS, "albertn" As UPD;

because of the sensitive personal nature of the information that
would be given here, i have had to alter the identifying information
(after carefully checking the material actually given in it for
accuracy); suffice it to say, the values for last/first/mi/mr which
are shown comport with their original's in appearance)

The statement looks fine, but I see from your next sentence why it was
failing.
lastly, you are right, both those fields you cited should be defined
as text fields in the underlying DaysView table, HOWEVER i found that
the Updated_By field had been changed inadvertantly to number field
Oops.

--- which i corrected to be Text.

the code ran w/o the data mismatch error!

Hurrah! It's fixed!
BUT following the focus
lines another message emerge ....

Object doesn't support property or method

following this line in the code below:

Me!DaysView!VisitType.SetFocus

I would guess that there is no control on the DaysView subform that is
actually named "VisitType". Check the name. "VisitType" may be the
name of the field the control is bound to, but not the name of the
control.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
D

Dirk Goldgar

Ted said:
tomorrow i go for my eye test, i promise!

i corrected the VisitType field's name and now this runs w/o that
error, YET when it does add a record to a patient's DaysView
datasheet, the screen scoots up to the mainform of the very first
patient in the database and props the cursor in the VisitType control.

Sorry, I overlooked another error in your code. This line ...
Me.Requery

.... which is intended to requery the subform, is actually requerying the
main form. Change it to this:

Me!DaysView.Requery
 
D

Dirk Goldgar

Ted said:
woops, i just reminded myself that the Lastedited field remains to be
solved for (needed to have the system autogenerate the DAteTime....

If you just set the Default Value property of the field, in the
*table's* design view, to

Now()

then the act of inserting a new record in the table, as you are doing,
will automatically assign the current date and time to the field at the
time the record is added. Do that, and you won't need to set it in
code.
 
T

Ted

dirk,

did i mention that i can't thank ya' enuff! this has been a real
'Everestian' climb, uphill all the way, but for the time being i can enjoy
the view from here to coin a phrase. this WORKS beautifully. you've been
great as is everyone who's ever had a hand in helping this relative newbie to
VBA. in my databases, this kind of parent child relationship recurs often,
and thanks to ya' i now have the wherewithall to implement this kind of
filtered autoincrementing capability in other contexts all of which adds up
to one big plus for the user's interface.

all the best,

-ted
 
D

Dirk Goldgar

Ted said:
dirk,

did i mention that i can't thank ya' enuff! this has been a real
'Everestian' climb, uphill all the way, but for the time being i can
enjoy the view from here to coin a phrase. this WORKS beautifully.
you've been great as is everyone who's ever had a hand in helping
this relative newbie to VBA. in my databases, this kind of parent
child relationship recurs often, and thanks to ya' i now have the
wherewithall to implement this kind of filtered autoincrementing
capability in other contexts all of which adds up to one big plus for
the user's interface.

You're welcome. Best of luck with your future Access endeavors.
 
Top