Results 1 to 14 of 14
  1. #1
    faca is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    52

    Long text - default value


    Hello!

    I would like to ask is it possible to set Long Text - Default Value only for some records not all?

    Thanks

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,880
    How will you distinguish which records get the default and which ones dont?

  3. #3
    faca is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    52
    Quote Originally Posted by moke123 View Post
    How will you distinguish which records get the default and which ones dont?

    By CompanyName

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,880
    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

  5. #5
    faca is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    52
    For company which name is TEST COMPANY i want that NOTES longtext default value is "RECEIPT FOR JOHN"

  6. #6
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,880
    Describe your process and what you are doing that will trigger when a default should be enterred or not.
    Are you entering a new record? updating an existing record?
    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.

  7. #7
    faca is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    52
    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
    Attached Files Attached Files
    Last edited by faca; 05-10-2019 at 05:58 AM.

  8. #8
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,880
    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.

  9. #9
    faca is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    52
    Quote Originally Posted by moke123 View Post
    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"

  10. #10
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    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

  11. #11
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    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.

  12. #12
    faca is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    52
    Quote Originally Posted by rpeare View Post
    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...



    "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

  13. #13
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    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.

  14. #14
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 24
    Last Post: 03-12-2019, 08:02 PM
  2. Replies: 15
    Last Post: 02-17-2019, 06:19 PM
  3. Replies: 3
    Last Post: 11-14-2018, 01:20 PM
  4. Long Text Issue
    By BAK2 in forum Database Design
    Replies: 4
    Last Post: 03-30-2017, 10:03 AM
  5. Long Text Box
    By data808 in forum Access
    Replies: 5
    Last Post: 09-24-2014, 12:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums