Two ?s: Design and Macro Issues

G

Guest

Hope this is ok to post these here:

I'm working on what amounts to a case database. My primary tables are 1 for
cases and another for parties (case parties like defendant, plaintiff, etc).
I'm pretty new to all this stuff but mostly I just need some concept of how
to proceed that I can use to guide my focus.

1. I have basic forms for inputing the info in the primary tables. What I
ultimately want to be able to do is this: open some type of form/query,
input a party (last) name, which will allow me to choose from anyone who has
that last name (or maybe in combo box just autocomplete the first of those
names and allow me to use the arrow to get to other potential names). Once I
have the right name, I'd like the form to "fill in" the key personal info.
Basically, I want to supply some info and have the form fill in the rest
(say I provide the name and the form fills in address, phone #, organization,
etc...various info from the tblParty I have) Then in another section
(subform?) list every case that this particular person is involved with.
Finally, I'd like to be able to click on any of the cases in that (subform?)
list and open up another window with the key case info (like parties,
status, case type, etc.....stuff found in the case table).

I think it's a form with a subform (the combination of the two making what
amounts to the first screen of the process), but I don't know the basics of
what I'm putting together. Is there some calculate function I need to add so
the form knows it's time to pull up the other info after I pick/input a name
in the main form area? Is the area of my form where the cases will appear
be called a "subform"? Is there some trick to linking case names to a popup
window so I can click on a case and get the details about it?

2. The second question relates to a problem I'm having with my current
project. I've set up some basic tables, forms, reports and a switchboard
that I made thru the switchboard manager. I have two main input forms and
two reports included in the choices I have on the switchboard (so far). The
problem is, one of the forms works fine when I click on the button on the
swtichboard that makes it pop-up. When I hit the buttons on the switchboard
for the other form and/or the two reports, they each pop open, but appear
behind the switchboard window and I always get this error:

DOC - Case Database can't find the macro 'DoCmd'
The macro (or it's macro group) doesn't exist, or the macro is new but
hasn't been saved.

Can someone tell me how to get rid of that message? There must be something
different in that one form versus everything else (other form and two
reports), but I just can't find it. Can someone point me in the right
direction? It's annoying to say the least.

As part of the learning process I've opened the vb editor thing and might
actually made it do something useful once, but if the solution is in there
I'm a complete novice and would need the click-by-click guide to get me to
the right spot...

Sorry for the long questions. Thanks a ton for any feedback.
CW
 
G

Guest

Oops, one more thing:

I get that macro message when I try to closes the second form or either of
the reports, not when I try to open them.

thanks,
cw
 
G

Guest

Cheese_whiz said:
1. I have basic forms for inputing the info in the primary tables. What I
ultimately want to be able to do is this: open some type of form/query,
input a party (last) name, which will allow me to choose from anyone who has
that last name (or maybe in combo box just autocomplete the first of those
names and allow me to use the arrow to get to other potential names). Once I
have the right name, I'd like the form to "fill in" the key personal info.
Basically, I want to supply some info and have the form fill in the rest
(say I provide the name and the form fills in address, phone #, organization,
etc...various info from the tblParty I have) Then in another section
(subform?) list every case that this particular person is involved with.
Finally, I'd like to be able to click on any of the cases in that (subform?)
list and open up another window with the key case info (like parties,
status, case type, etc.....stuff found in the case table).

I think it's a form with a subform (the combination of the two making what
amounts to the first screen of the process), but I don't know the basics of
what I'm putting together. Is there some calculate function I need to add so
the form knows it's time to pull up the other info after I pick/input a name
in the main form area? Is the area of my form where the cases will appear
be called a "subform"? Is there some trick to linking case names to a popup
window so I can click on a case and get the details about it?
You have the basic structure correct. A main form shows the party info and
the subform shows the case info. This is essentially a one-to-many
relationship and form/subform is perfect for it. To select a name and have it
retrieve the party's record, put an unbound combobox (no control source) in
the form's header section. The rowsource for the combobox will be fields from
the parties table. For the fields in this combobox, you at least need the
table's primary key, the field that uniquely identifies a record. The trick
to using this is in the combobox's AfterUpdate event. You'll need a macro or
some code to set the form's record to the selected record's id from the
combobox. Write back if you don't understand how to do this.
2. The second question relates to a problem I'm having with my current
project. I've set up some basic tables, forms, reports and a switchboard
that I made thru the switchboard manager. I have two main input forms and
two reports included in the choices I have on the switchboard (so far). The
problem is, one of the forms works fine when I click on the button on the
swtichboard that makes it pop-up. When I hit the buttons on the switchboard
for the other form and/or the two reports, they each pop open, but appear
behind the switchboard window and I always get this error:

DOC - Case Database can't find the macro 'DoCmd'
The macro (or it's macro group) doesn't exist, or the macro is new but
hasn't been saved.

It sounds like there's an incorrect line of code behind either the
switchboard form or the pther objects. Check this by opening the VB editor
(Alt-F11) and compiling the application (the first command under the debug
menu). If there's an invalid line of code, the compile will highlight it. You
can also search for the word "docmd" by clicking control-F and choosing the
Current Project option. When/if you find the offending code, delete it.

Barry
 
G

Guest

Thanks for the reply, Barry,

I sort of follow you on the first part. I'm going to need to chew on that a
little. I know where the row source and the control source areas are under
properties, but I've only used the form header section really for just
looks in my forms. I also don't know if you mean to imply that the combo box
will be located in the header and used to pick the party, with all the other
info showing up down in the detail section (but I think that's what you
mean).

The real issue will be the coding, which I know very little about. I'm not
from a coding background other than manipulating website code for a while,
mostly javascript or dhtml. But I never really have written anything in any
language, and I'm new to vbscript.

As for the other issue, I used the alt-fll while my db was opened and looked
under the debug menu and the compile option was greyed out.... I still
really don't know much about that script editor so other than trying that, I
don't even really know what functions of the editor goes with what tasks I
might want to accomplish. I may need to find some tuts on that or buy a book
or something...

Thanks again,
cw
 
G

Guest

Got that second issue figured out. There was an on event command associated
with the switchboard. Thanks.

cw
 
G

Guest

Cheese_whiz said:
Thanks for the reply, Barry,

I sort of follow you on the first part. I'm going to need to chew on that a
little. I know where the row source and the control source areas are under
properties, but I've only used the form header section really for just
looks in my forms. I also don't know if you mean to imply that the combo box
will be located in the header and used to pick the party, with all the other
info showing up down in the detail section (but I think that's what you
mean).

Yes, that's what I mean. You'll also have to make sure the form's Default
View property (on the format tab) is set to Single Form.
The real issue will be the coding, which I know very little about. I'm not
from a coding background other than manipulating website code for a while,
mostly javascript or dhtml. But I never really have written anything in any
language, and I'm new to vbscript.

You could do it with a macro instead of code. Go to the Events tabs for the
header's combobox. Click the elipsis (...) to the right of the AfterUpdate
event and select Macro Builder. Name your macro something meaningful, like
SetParty. In the macro, choose SetValue for the first command. At the bottom,
in the Item field, you;ll have to point to the Party id field of the form.
You can use the expression builder to help you. In the Expression field,
you'll specify the value of the header combobox. This macro reads the
selected value from the combobox and sets the record of the form to that
value. Save the macro and give it a try. You might have to play with the
values a little.
As for the other issue, I used the alt-fll while my db was opened and looked
under the debug menu and the compile option was greyed out.... I still
really don't know much about that script editor so other than trying that, I
don't even really know what functions of the editor goes with what tasks I
might want to accomplish. I may need to find some tuts on that or buy a book
or something...

Oops. The compile option is grayed out until you make a change, any change,
to the code, even a spacebar.

Barry
 
G

Guest

Thanks again, Barry.

Might not get to this part till this weekend or Monday, but I think I have
just what I need to get something at least close enough to start cussing at.
:)

Thanks again,
cw
 

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

Top