you're welcome
btw, don't be afraid to explore macro actions. an easy way is to open a
macro in design view, choose an Action from the droplist, leave the cursor
in the Action field, and press F1. takes you right to the topic in Access
Help. i taught myself Access and developed databases for a few years before
taking Access courses in night school - and i spent tons of time in Help,
reading up on macro actions, form properties, everything really, trying to
figure out how to use them to accomplish what i wanted. this was years
before i ever knew anything about newsgroups, or even the Internet. there's
a wealth of information right at your fingertips, it just takes time and
determination to use it.
hth
thanks tina. I'll try this when I get back from a short visit.
tom
:
add either a macro or an event procedure to the form's OnCurrent event,
as
[macro]
Action: Requery
Control Name: cboFindClient
or
[procedure]
Me!cboFindClient.Requery
in either instance, use the correct name of the combo box, of course.
if you want the new record to show up in the phone number combo box
also,
simply add a second macro action, or second line of code, using the name
of
that combo box.
hth
tina,
I'm sorry to bother you again, but I noticed that I have a problem
with
new
records. Remember, we put a name sort in rowsource of the combo box
to
display the names in sequence. But when I key a new record, it
doesn't
get
sorted back with the others until after I close the file. The
potential
problem is that I could key duplicate records in one session. Is
there an
easy remedy for this? Thanks.
"tom"
:
comments inline.
OOps. I should have read your complete post before I signed off
on my
previous comment. I thought I might have known how to do this
event,
but
I
don't guess I do. I guessed that I would go to the Activity
subform
and
click on the form properties where I do see the Onopen. I also
see
the
....
which takes me to build expression, macro expression or code
builder.
good, you got it right so far - especially making sure that you're
in
the
Activity (sub)form, and *not* in the main form. one thing: go to
the
OnLoad
property first (we won't try OnOpen unless OnLoad doesn't work).
I
don't know what to do next.
now, in the Choose Builder dialog box, click on Code Builder and
click
OK.
Access creates the event procedure, and takes you to it, in the VBA
window.
paste in the code i gave you in previous post; when you've done
that, it
should look like below:
Private Sub Form_Load()
Me.OrderBy = "NameOfDateField"
Me.OrderByOn = True
End Sub
remember to substitute the correct name of your date field.
hth
Help again. Thanks.
:
hmm, a little bit of VBA code should get a sort to work for you
in
the
subform. try adding the following code in the subform's module;
try
it
first
in the OnLoad event, and if that doesn't work, then try it on
the
OnOpen
event instead, as
Me.OrderBy = "NameOfDateField"
Me.OrderByOn = True
the above will give you an Ascending sort. if you want a
Descending
sort,
change the code to
Me.OrderBy = "NameOfDateField DESC"
Me.OrderByOn = True
if you don't know how to create an event procedure in the form's
module,
post back and i'll give you directions (it's easy to do).
hth
You came through again tina. Now why didn't I think of that.
You
saved me
another day at least. I played all afternoon trying to figure
that
one
out.
By now, you have given me a pretty good input form. I did give
up
on
the
sequencing of my child records on date. Of course there was
no
row
source
that I could easily use like we did on the parent, and then I
tried
using
a
query as a table for my child subform, but that didn't work
either.
Actually, I'm pretty well satisfied now with the whole thing.
Thanks
again
and I'll give you a well done also.
Tom
:
hi again, Tom. here's a suggestion: just add a second combo
box
right
below, or right beside, your existing cboFindClient combo
box.
use
the
wizard to build it, as before; only this time, select the
PhoneNo.
field
to
search on, instead of the name field(s). i've often used
more
than
one
"find
a record in my form" combo box on a single form, to give my
users
more
than
one search option.
hth
Yes, I'm back again. I'll relay what I need rather than
relay
all
the
ways I
have been trying to do this. I have a many-to-one data
base
with
a
form-subform arrangement related by an auto number and
using a
combo
box
to
search on name which brings up matching records, if any,
before
entering
the
data. I'm using the form exclusively for editing and data
input.
The
forms
to be keyed may already be in the file, but because of
almost
illegible
hand
writing, I want to make a search on phone number and
retireve
the
data
before
I decide to key a new record. Soooo, what I need is a
command
button
on my
form which would invoke a Search Macro on the file and
give me
the
choice
of
pulling up any matching phone numbers into the main
form/subform.
If
no
match, then tell me no match and return to where I was.
One
problem I
had
in
trying this was that my macro didn't wait until after I
keyed
the
phone
number before starting the search. I'm afraid I need
help.
Thanks.