Hello!
I would like to ask is it possible to set Long Text - Default Value only for some records not all?
Thanks
Hello!
I would like to ask is it possible to set Long Text - Default Value only for some records not all?
Thanks
How will you distinguish which records get the default and which ones dont?
You'll need to explain a little more than that.
Describe your process and what you are doing that will trigger when a default should be enterred or not.
You can set a default value for a field with code.
for instance
Code:If Me.NewRecord then Me.SomeField.defaultvalue = "x" End if
For company which name is TEST COMPANY i want that NOTES longtext default value is "RECEIPT FOR JOHN"
Are you entering a new record? updating an existing record?Describe your process and what you are doing that will trigger when a default should be enterred or not.
Are you selecting a company from a combo box? Where's the Company value coming from?
There needs to be some sort of event to trigger the code.
We may also be thinking differently as far as a "default value." A control has a default value property which you can set in the property sheet or with code.
On the other hand if you are selecting a company from a combo you would run the code from the after update event. You would not really be setting the default value of NOTES, you would be setting the value.
I open service form, select vehicle and than customer info and vehicle info is auto-populated
I need to enter:
Date of service
Kilometers
Paid?
PaymentType
Notes
I want that everytime i choose car which owner is TEST COMPANY .. There will be "receipt for luke" in service notes
Last edited by faca; 05-10-2019 at 05:58 AM.
To be honest I'm kinda at a loss to figure out what your doing.
I looked at your db. I dont see that you have any event in the combo box for selecting the vehicle yet data changes when you make a selection. It could be a language problem on my part.
I do see you don't have Option Explicit declared in each module and adding it throws errors in your code.
To be honest I'm kinda at a loss to figure out what your doing.
I looked at your db. I dont see that you have any event in the combo box for selecting the vehicle yet data changes when you make a selection. It could be a language problem on my part.
I do see you don't have Option Explicit declared in each module and adding it throws errors in your code.
Choose vehicle combobox has 2 columns:
First is License Plate number
Second is VIN number
This combobox is (VehicleID, LicensePlate, VIN)
I don't know how can i tell you other way so you could understand ...
I just want that every time i create new service for car that is owned by TEST COMPANY .. i need NOTES to be filled with text "receipt for Luke"
I can't get anything to be accepted in the "Company" text box. It is easy enough to do a check on the value of a text box and then control other items like you want to but you have to be able to place something in the text box first.
[Edit] The "Company" text box is locked so nothing can be entered, when I unlocked it and tried to put in code to Make "Receipt for Luke" appear in the notes text box other strange behavior started happening (Strange for me anyways).
Dave
You have something funky going on with this form.
Is there a reason you're looking up by a vehicle ID you can't even type in? Why not look up by a customer name then select the vehicle associated with that customer. I looked at your form for few minutes but something's going on on that screen using an activex control which I couldn't (didn't spend the time to) identify. I would rework your data structure so your customers table could be either a company or a person and if it is a company have a 'default note' field set up so any invoice to that company would inherit the default note. Lastly I would make your service screen look up by customer, *not* by the internal vehicle number of your database or the VIN which. If you must you could add a search for the VIN as well.
Well i'm not pro in microsoft access so i made form like this i mean it's the only way i knew how to make it...You have something funky going on with this form.
Is there a reason you're looking up by a vehicle ID you can't even type in? Why not look up by a customer name then select the vehicle associated with that customer. I looked at your form for few minutes but something's going on on that screen using an activex control which I couldn't (didn't spend the time to) identify. I would rework your data structure so your customers table could be either a company or a person and if it is a company have a 'default note' field set up so any invoice to that company would inherit the default note. Lastly I would make your service screen look up by customer, *not* by the internal vehicle number of your database or the VIN which. If you must you could add a search for the VIN as well.
"Is there a reason you're looking up by a vehicle ID you can't even type in?"
Why would i type in? I just need to select which car (By first column License plate) i will service and other car info will be auto-populated same for customer info.
If new car comes for service to my garage.. i first add customer than i add car and than i make new service for this car
"Why not look up by a customer name then select the vehicle associated with that customer."
I actually don't know i mean it's easier for me to search for car by license plate than searching customer and than selecting car
Searching by license plate is no measure of whether you're looking at the right vehicle. What happens when someone gets a different license plate for the same car? What happens if they transfer the license plate to a new vehicle? Then all your service records are hosed because they don't apply. And if you look at your combo box with the license plate numbers, you have to use the mouse to scroll down to find what you're after. If you want to be able to look up by license plate I would make the first column of that combo box zero width so the combo box will autofill when you type it in, but again, I don't think the license is a great idea.
I think ideally your lookup screen should be able to take any one (or many) search variables to find the record you're after. I haven't looked at your form anymore to figure out where the activex error is being generated but I get it every time I add a new record so I haven't done much with your form at all, just a little analysis to figure out how it was trying to work.
faca,
Others have hinted, but I'll say it more directly in the hope of getting a clear picture of your business and requirement. In order for readers to offer focused advice they/we have to understand you, your business and your issue in context. We need an overview (the 30,000 ft level) of your business; then gradually add detail that highlights What you want to achieve (plain English is fine). When you post a copy of your database, please advise of any issues, conditions to get to and experience the issue you are facing.
See the Car Dealership info at this link and see the points being made to communicate the business and processes to the reader.
The Database Planning and Design link in my signature has many articles that could help you with database concepts and analysis techniques. It would be beneficial to you to work through 1 or 2 of the tutorials from RogersAccessLibrary that are mentioned in the link. You have to work through the tutorial (about 30-45 minutes) but you will learn, and what you learn can be used with your proposed database. You will experience the process/procedure to design a data model to represent your database, and you can test and adjust that model before building the physical database. Your vetted data model becomes a blueprint for your database.
Good luck with your project.