My form won't open since I created a macro

M

Morgaine

Hi:
I created a macro (based on one that worked perfectly in Word) and set it to
run in Access when a particular field was filled in....or so I thought.

I can no longer open the form.

Is there a way to stop all macros/modules from operating in a form so I can
open it.

This is the first time I have attempted using macros in an Access database
and am very new to coding.

Is my form a lost cause? I have put so many hours into it, I hate to have
to start over.

Thank you in advance for any assistance offered.

Linda
 
S

Steve Schapel

Linda,

First of all, the woird "macro" in Access referes to a completely
different entity than macro in Word. It sounds like you are referring
to a VBA procedure rather than a macro.

Do you mean you are not even able to open the form in Design view? What
exactly happens when you try?
 
M

Morgaine

Hi Steve:
Sorry for the delay in responding. I hope you see this.

I open the database and under the FORM section, I click on the name of the
form and nothing happens. It won't allow me to even change it to design
view. I have tried everyway I can think of to open it...right click open,
double click, use the open icon...it doesn absolutely nothing except
highlights.

Any ideas?

Thanks,
Linda
 
S

Steve Schapel

Linda,

I am sorry for the delay in getting back to you here. And I am sorry to
say that I don't know what the problem is, it is not a normal thing to
happen. Perhaps some corruption in your database project. It sounds to
me like you need to investigate it by checking the form in a backup copy
of the database, or create a new database and try importing the form
into it. Or else delete the form, copmpact/repair tha database, and
then re-build the form from scratch.

Let us know if you need any help with any of these ideas.
 
M

Morgaine

Steve:

I will try what you suggest. At this point I think it would be fastest to
reconstruct the form. I think I must have corrupted the file when I cut and
pasted the Word macro into Access.

Is it possible to have Access automatically populate fields? For example, I
want to have the date entered in a field on the form automatically populate
12 fields below it by month. If 5/2/08 was entered in the inital field,
then May, June, July, August, September, October, November, December,
January, February, March, April would be automatically populated in the 12
field below.?

I do not know Visual Basic yet. A VB course is on my upcoming agenda. I am
great at cutting and pasting code though. :)

Thank you for your input.

Linda
 
S

Steve Schapel

Linda,

Are you talking about entering this data in the same field in 12
records, or do you literally mean you have 12 separate fields in each
record?

Warning: If it's the latter, I will almost certainly be telling you it
is an invalid database design! :)

By the way, in the interests of clarity of communication, note that
forms do not have fields. Fields are in tables or queries. And the
data stored in those fields can be accessed via *controls* on forms or
reports.
 
S

Steve Schapel

Linda,

Well, it's not exactly that it *can't* be done. Just that it
*shouldn't*. It's the kind of thing you would see in a spreadsheet and
stuff like that. But in a database such a design is called
un-normalised. In a databse, we would recognise that there is a
one-to-many relationship between the entity of the person, and the
entity of whatever is represented by the M1-M12 fields, and as such
needs a separate related table. As for the presentation of this data on
a form, the standard approach would be a main form for the data on the
"one" side (i.e. person specific) and a continuous view subform based on
the "many" side table(s).

Hope you understand.
 
M

Morgaine

I think I understand. The patient would have a one-to-one relationship with
his name, his medical record number, his birthdate, his admission date and
his discharge date. Month 1 would have a one-to-one relationship with the
different due dates for that month only. Month 2 would have a one-to-one
relationship with the due dates entered for that second month only, etc. So
there would have to be a table for the patient, another table for Month 1,
another table for Month 2, etc.

It seems then that an Excel spreadsheet might be more appropriate. I was
hoping to do queries and create reports from the data which is why I thought
of Access. Plus I never learned Excel. Perhaps it is time that I did.

Thank you, Steve for your time and consideration of my proposed project. I
appreciate your help.
 
S

Steve Schapel

Linda,

No. You would not have a separate tabgle for each month. I am not able
to comment explicitly, since I have no details at all about the data you
are working with, or the place occupied in the grand scheme of things by
these dates you are referring to. But I can absolutely say for definite
sure that you will not have a separate table for each month.

If you would care to explain the purpose of the data, and the meaning in
particular of the dates, I would be happy to explore further with you.
 

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


Top