multiple check box restriction

antonyx

Arsenal Supporter
Local time
Today, 23:47
Joined
Jan 7, 2005
Messages
556
Code:
Private Sub Form_Current()
If Me!pairport Then
Me!pterminal.Enabled = True
Else
Me!pterminal.Enabled = False
End If

If Me!dairport Then
Me!dterminal.Enabled = True
Else
Me!dterminal.Enabled = False
End If
End Sub

Private Sub pairport_AfterUpdate()
If Me!pairport Then
Me!pterminal.Enabled = True
Else
Me!pterminal.Enabled = False
End If
End Sub

Private Sub dairport_AfterUpdate()
If Me!dairport Then
Me!dterminal.Enabled = True
Else
Me!dterminal.Enabled = False
End If
End Sub

ok i am trying to make this rule apply for the destination part aswell, which is dterminal and dairport

gettin this problem

runtime error 438
object doesnt support property or method
 
When/where do you get the error. In debug mode, a statement should be highlighted. It would tell you WHAT doesn't support the method.

By default, the .Value property is tested in Me!{control-name} so that part is probably not wrong. The .Enabled property is valid for any updatable control so that should not be wrong, either. Which leaves a couple of questions of scope and/or visibility. Knowing the statement that is highlighted would help focus on the problem.
 
Me!dterminal.Enabled = False

error on that line
 
can nobody help me.
simple i just made a form, simple form consisting of the fields from a table

tried to incorporate a workin checkbox restriction on another field (drop down menu) in two separate checkboxes.

have names all the parts, tried puttin code in both of the after update events of the checkboxes, and i thought i had to place both the commands for each of the separate checkboxes in the current event of the form also

in my table design i have set both the default values of the yes/no fields to no.

if anyone can help me i would be very grateful. as soon as the form is opened, the error arises and i have pointed out the line of the error in the code.

how can i get around this???
 
My best guess is that you have named the lable rather than the check box!
doulble check your naming in the form!

Peter
 
I go back to your table design. If you are not going to normalize your data you will continue to encounter problems.
 
ok scott, what i will do is be sure in my mind what has to be stored and so on.
i will then draw an entity and relational model and give u the url for the jpg.

if you could have a quick glance at it, and maybe suggest a few improvements i would be very grateful.

in terms of my ms access capabilities, there is still much for me to learn, im only just fiddling with the 'code' of each part. therefore, the best best way to do it will probably be to high a standard for me to aim for at the moment, so if you can do, bare in mind my flaw if you give and advice on my future diagram.

north london is grateful
 
antonyx said:
ok scott, what i will do is be sure in my mind what has to be stored and so on.
i will then draw an entity and relational model and give u the url for the jpg.

if you could have a quick glance at it, and maybe suggest a few improvements i would be very grateful.

in terms of my ms access capabilities, there is still much for me to learn, im only just fiddling with the 'code' of each part. therefore, the best best way to do it will probably be to high a standard for me to aim for at the moment, so if you can do, bare in mind my flaw if you give and advice on my future diagram.

north london is grateful

Some things are best to get right in the beginning otherwise you will be trying to compensate for them for a long time. This site and others like it, exist to help people get it right. Personally, I would much rather spend a lot of time helping someone get it right then a few minutes helping them to jury rig something because the underlying structure is wrong.
 
ok have a look at this

http://k.1asphost.com/forum66/er.jpg

this is how the database is gonna be laid out.
the addresses in the job table will not be the same as the original addresses for the customers, they will be specific to the job.

there are a few general questions i have regarding the specifics of the system, but is this layout more appropriate?
 
Much better, but a couple of points. First, is it possible for a driver to use different cars? If so, you probably want to include the Car in the Jobs table instead of the drivers. Second, isn't the Customer an employee of the company? If so, then Company should be a child of Customer with a FK in Customer. Third, isn't it possible for customers to consistently get picked up from the same address and go to the same address? What I would have is two tables:

tblAddresses
AddressID (PK Autonumber)
streetAdd

tblCustAdd
CustAddID (PK Autonumber)
CustomerID (FK)
AddressID (FK)

With this structure, you can filter the addresses by customer and the operator can consistently select a proper address. You can take this further By storing map cordinates for the addresses that can be passed along to the driver.
 
the system itself is designed for the staff of the cab company, who receive calls from customers who wish to book jobs.

here are some of the rules:
a driver will only ever drive one car

a customer table is needed for regular customers (their home contact details and name and so on).

however, a job entered may or may not involve the customers home address within a pickup or destination.

this is why i originally placed cust name, cust no. in the job table, because otherwise if every customer detail that is entered through a job form is stored, each customer may have several addresses for their name.

also each pickup or destination address will or will not be an airport address.
if an airport is selected, it will only ever be from one airport, and all that is required is a terminal number 1-5.

i do appreciate this tutorage.

one more point, the database is not going to be integrated fully into the daily business processes at this time. it wont be -live and up and running. jobs may be entered at different times of the day (or in batches) which is why the user is free to enter their own date and time for a job.
 
I've had some experience with dealing with car services. The department I work for is responsible for dealing with the services used by our employees. I've had some conversations with the people there.

Therefore, I still think you should be providing for future growth in the use of this. Even if it won't be used for displatching now, if its designed right then it can be used that way in the future. Also, if the cab company has or wants to have corporate clients, then those clients may demand the type of reporting that my suggestions will allow.

If a driver will only ever drive one car, then that relation is correct and don't change it.

But, I know from experience, that if there are regular customers they WILL be picked and be driven to regular destinations. Yes a customer might have several pickups and/or destinations associated with them, but I don't see that as a problem. By using the table structure I suggested in my last response, addresses can be easily added to the table using the NotInList event of a combobox. Basically this could be almost transparent to the user. They select from a list of addresses associated with the customer. If its a new address, they type it in. The NotInList event then triggers. They can be asked to confirm the entry as a new address or just automatically add it. In this way, the user still does almost the same thing. But the ability to select an address from a list speeds entry and ensures data integrity.
 
ok, i am seeing what you mean, this of course would be the best solution.

Code:
tblAddresses
AddressID (PK Autonumber)
streetAdd

tblCustAdd
CustAddID (PK Autonumber)
CustomerID (FK)
AddressID (FK)

ok

basically what would be ideal is if i could keep track records of each customer and each address they goto. do you think i should incorporate some initial parameter before any job form is shown.

eg, you enter a phone number.. and the details if found are displayed including the customer name and address they last used, maybe it could then ask, is this the address you are being picked up from, or going to, and have some kind of method of choosing that address as either the pickup or destination. if they are using a different address, then you could add a new address for that customer. if no customer is found from the phone number search, a blank screen is shown and the user fills in the address.

would this lead to any problems or complications when querying the jobs per customer and addresses per customer in the future.

i cannot quite envision how the tables can be thought up and linked together to incorporate these features or possible interfaces
 
You are very close here. You have a Customer combobox on your Ride entry form where a Customer is selected. If you want to do it by Phone number you can. You use the NotInList event to open a blank form to enter the Customer info. You then filter the Address combos (Pickup and Destination) by the customerID so you can select addresses used by that customer.

I've attached a text files with examples of the NotInList code you can use.
 

Attachments

it seems to work apart from this error - couldnt i add "on error resume next"?
 

Users who are viewing this thread

Back
Top Bottom