R
robert.f.smith
Ok,
I reviewed all this, and I'll try to answer in order.
First
The Primary key is ID in the tblCustomers.
Hey guess i was reviewing your questions one by one, and it works now. I
think it may have worked after making the changes you suggested before, or
maybe after I made sure that the customer ID bound correctly to the the
tblcustomers.
I also may have had garbage data. I really only had teat data, so i made
some changes to the data and I think i'm goo now. I stoill havce more to do,
I will probably be calling one you soon again.
My next problem is modifing the ophone search routine. i want to put an if
in place to test the input number against all of the phone number fields. If
it finds a match in any field it should bring up that customer. Do you
suggesgt an if or a case statement, I will show you what i've done so far.
It bombs for some reason.
I need to find it and I'll send it on over.
Cheers
Bob
I reviewed all this, and I'll try to answer in order.
First
The Primary key is ID in the tblCustomers.
Hey guess i was reviewing your questions one by one, and it works now. I
think it may have worked after making the changes you suggested before, or
maybe after I made sure that the customer ID bound correctly to the the
tblcustomers.
I also may have had garbage data. I really only had teat data, so i made
some changes to the data and I think i'm goo now. I stoill havce more to do,
I will probably be calling one you soon again.
My next problem is modifing the ophone search routine. i want to put an if
in place to test the input number against all of the phone number fields. If
it finds a match in any field it should bring up that customer. Do you
suggesgt an if or a case statement, I will show you what i've done so far.
It bombs for some reason.
I need to find it and I'll send it on over.
Cheers
Bob
Graham Mandeno said:Hi Bob
Can you please confirm that:
1. The primary key field in tblCustomers is named "ID"
2. This field is present in the record source of the form which contains the
code below.
3. The foreign key field in your Orders table is named "CustomerID".
4. This field is present in the record source of the form
"tblCustomers_orders_Query".
I don't understand what you mean when you say:
The other thing is that when i change the field in the form to
=tblCustomers!ID it throws a debug error
Do you mean that you are trying to set the controlsource of a textbox to
that expression? There should be no need to do that. Simply bind the
textbox to the field by setting its ControlSource to "ID".
Also, do you really have forms whose names start with "tbl"? If you don't
find this confusing, then someone else certainly will, assuming that name is
for a table. If you wish to use naming conventions with prefixes (and it's
a very good idea to do so), then I suggest you prefix your form names with
"frm".
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
"(e-mail address removed)"
Well yes and no. I got it to pop up the correct table, but it doesn't find
the correct record.
I've been messing with it, but still haven't gotten it correct.
here is the code now.
Private Sub cmdOrders_Click()
Dim strWhereCond
strWhereCond = "CustomerID = " & Me!ID
DoCmd.OpenForm "tblCustomers_orders_Query",
wherecondition:=strWhereCond
End Sub
The other thing is that when i change the field in the form to
=tblCustomers!ID it throws a debug error
It says i'm using the wrong syntax.
Here is the error
Run Time Error '2447'
There is an invalid use of the dot (.) or ! operator or a invalid
parentheses.
When i make it just ID it works but brings up the wrong record.
But it does bring up the correct form with data populated just that it
does
not releate to the customer ID in the order form.
Strange
Thanks Again for you help
Bob
Graham Mandeno said:Hi Bob
Did you manage to get this working?
--
Best regards,
Graham Mandeno [Access MVP]
Auckland, New Zealand
"(e-mail address removed)"
Sorry, I don't mean to be scant with my info. I have to revisit the
error.
I'm at work, and the most recent .mdb is at home. I beleive it was
failing
on
the line of code you had sent me last. Of course VB's debugging leaves
something to be desired. I will try your last comment, if it fail, i
will
send you more info.
Thanks again for your help.
Bob Smith