Of course, you're absolutely right - my mistake - Doh!!
I'll try posting on tek-tips or something!
Thanks again for your help!
Thanx for that Thomach, but it's Access I need to use.
Perhaps if I put it this way..
I want to have a record card for each driver on which I can list the trucks he's driven and how many miles he drove on each.
I also have 5 card boxes - 1 for each truck.
Now if I assign Alf to truck T1, I put his card in T1's box, Bert's in T3 (or wherever) and Charlie's card is on the desk because he's on holiday.
The next day/week/month, Truck T1 goes in for service so Alf gets reassigned to T5.
During all the time he was using T1, it and he accumulated (say) 300 miles, so that gets written on his card under T1, and added to his running total.
It's kind of like trying to replicate a T-card system in Access, I guess.
Does that clear the mists a little?
I hope one of you Access gurus can help me with a table relationship problem:
Say I've got 3 drivers; Alf, Bert and Charlie, and 5 trucks; T1 to T5.
Each driver can only be assigned to one truck at a time, ie if there's a record for Alf on T1, I can't raise a new record for Alf on T2 until I've removed him from T1.
The same thing applies to the trucks; if T1 is assigned to Charlie, I can't assign Bert to T1 until I take Charlie out of its cab.
How should I set up the Tables/Relationships so I can track the following:
1. Cumulative Total Miles.
2. Cumulative miles on each truck.
1. Cumulative Total Miles.
All without allowing any driver/truck conflicts?
The actual application will be more complex, and not truck-related, but that about summarises what I need to do - can it be done?
Thanks for replying Roy, but sadly it didn't work.
I don't seem to be able to get anything into the RefEdit unless I type or paste it in; in that respect it's no better than a text box!
The attached worksheet shows the effect I'm trying to get. It uses a UserForm with a RefEdit on it which works perfectly!
Maybe RefEdit controls only work on UserForms??
This should be dead simple:
1. Put a RefEdit Control on a worksheet (from the Control Toolbox).
2. Add a Button beneath it.
3. Name cell D1 "AddressLine" (or anything you like).
4. Code the button like this:
Private Sub CommandButton1_Click()
Range("AddressLine").Value = RefEdit1.Value
5. Select the RefEdit box, drag over cells A1 to A10, click the button and D1 reads "Sheet1!$A$1:$A$10".
Only it doesn't work. The RefEdit doesn't collapse when you click its button, nothing appears in it when you drag over or select any cells, and D1 stays blank.
The only time it works is if you type something in the RefEdit box, like "BLABBER", then press the button, D1 reads 'BLABBER'
What am I doing wrong?