hi everyone,
I have a doubt on how do I don`t put the same value in two different registers?!
Explaining better:
I have "booking table" and in that I have "client ID" as an lookup, to choose which client I want in the firt book!
So on the first booking I put one ID. However, this client MUST be excluded of the options to put in the others bookins becasue the bookings due on the same time and day.
So, how do I exclude on the lookup the register put on the first register, making impossible the client appers twice on different bookings!!??
Was that clear?
Thaks in adv.
Beck
vbaInet
03-06-2010, 06:00 AM
I don't clearly understand what you've explained but these could be what you're looking for:
DLookup or DCount
IF ... ELSE ... statement
Look those up in the help files or do a quick google search.
gemma-the-husky
03-06-2010, 06:16 AM
when you pick a client, you need to use a query that selects the unused clients, not the clients table itself.
look at unmatched queries
The point is:
in the table named booking, I have to put the clients ID on, in each booking!
so, to do that I`ve linked the clients ID with the other table named clients. So, I did the lookup to show the numbers already registered in the clients table on the booking table. So I can choose on the menu bar which client I want.
However, in the second register, I don`t want the client who I put n the first book apperas on the menu bar in the second register.
how do I do that?
vbaInet
03-06-2010, 06:26 AM
You are using the wrong object for this purpose and you can't do it through there anyway. You should use a form for data entry and not via the table. Create a form for entering your client information and/or bookings.
So, what I'm want to do is impossible?
there is no way to do that?
I'm afraid of put 1 client in 2 different bookings at the same time and day.
how is another way to avoid it?
thaks for the answer guys!
vbaInet
03-06-2010, 06:44 AM
If you create a form and have it in a Datasheet view it will look almost like a table.
A table is for storing data. A form is form manipulating the data (i.e. deleting, updating, inserting into) and even retrieving. With good use of queries and forms you could achieve alot. You can base the record source of your form to the query. Sub queries would come in handy for what you want to achieve. Have a look at this:
http://allenbrowne.com/subquery-01.html
But only use them in your query if you're going to use a FORM for data entry.
Read up on that.
Brianwarnock
03-06-2010, 07:25 AM
I thing Gemma was suggesting using a combo based on an unmatched query between a clientsid table and the booking table.
I've done a rough idea of what I think he meant.
Hope it helps, but doubtless it can be improved.
Brian
vbaInet
03-06-2010, 07:50 AM
It looks like the OP is using the table for making the bookings and I was trying to detract the OP from doing that. Bad practice.
Look at the OP's attached screenshot.
Brianwarnock
03-06-2010, 08:03 AM
Yes I read post#5 , I'm just hoping we get through to him/her.
Brian
vbaInet
03-06-2010, 08:13 AM
One can only hope. He/she would hopefully see the essence of forms from your example.