Results 1 to 4 of 4
  1. #1
    aabh is offline Novice
    Windows Vista Access 2000
    Join Date
    Jan 2010
    Posts
    14

    Learning VB

    It's becoming more and more clear that I can't accomplish what my company needs without me writing VB... but, as I'm noticing with my question in the Forms forum, I am grateful that people are willing to help... but I can't even follow the logic of the code. Sure I can see that "Combo2" is my combo box, and I know that "Left(4)" means to take the left 4 characters from that combo box, but it's like hearing a whole bunch of words that mean something in a sentence that doesn't. Like if one heard: "Cat 2 Len walk parcheeze "202" or slip as binkie" I know what those words mean, and could even recover a picture in my brain of the objects... but the syntax is so wierd that I can't gather overall meaning.... I don't know what that sentence is trying to say.



    It's not that declaring objects and making expressions is unclear to me: I do actually get that (I'm great at Excel and in the hand-holding mode of Access). It's that I don't quite follow how declaring an object and subcommands and private/public commands help me manage data in a database.

    I mean, a Database has pretty much three functions: Store data, Retreive Data, manupulate Data. Philisophically that is sort of like a file cabinet, Open file cabinet, find file, read file, change a field on the file, put the file back.

    So, I understand declaring an object... but what is that in the File cabinet analogy? Is that getting the pen? Is that the idea that I have in my brain of the data that I'm looking for? Does Public mean looking for a file in the office as opposed to Private which means in the file cabinet itself (not practical, but I could totally understand that)?

    And what part of the code is "find file", "read file"?

    Here's a sort of mid-thought example:

    I want to take Table (Customers) and get the first three letters from the field (Names) and put them into the field (First3). I know I need a Left([Names],3) in there somewhere (That's no different than using Excel). But 1) Where would I put this code, and 2) When would it happen? (Does it occur to every field as soon as I open the database? Does that mean it would re-write the fields every time the database is opened? What if I put it on a Form called (Check)?

    Can anyone kind of lead me through this? I think if I can just make this one logic link, I can start doing my own programming... (Because, like any code, I can start to translate the rules over and learn what acRecordsMenu and Me.combo1 means)

    Thanks!

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931

    Update Table

    Relax you are all too worried, goggle and download some books on VB scripting. There are many good online tutorials that will be a great help to you. No body can learn everything and there is always something more to learn. If you have a good mathematics base and you can think logically programming is easy and you have this wonderful forum and we are here to help you.

    Now for your question:

    Let me get this straight. You have a table called Names and Field3. You want to copy the first three letters on the Names in the Field3. Although you have not provided sufficient information I will suggest you a way to do it.

    Go to query and create a new query on the menu bar select query and then select update query.

    Then select the table and then select the two fields Name and Field3

    In Update To Row in the Field3 type the Following code: =Left([Names],3) this will update the Field3 with the First three values of Field Names.

  3. #3
    aabh is offline Novice
    Windows Vista Access 2000
    Join Date
    Jan 2010
    Posts
    14
    Thank you for responding

    Actually, the frustration here is because of just that... I started using Access in 2000, to retrieve reports as a Reports Analyst... Even then I knew that I needed to learn Visual Basic... but it always starts with the syntax to write code (Which makes sense), but I still don't know (As an example) how declaring an Integer will get my data from my database, convert it, and put it in a different field... Since the data is already in the Database... why would I need to declare anything except just the field?

    The above example isn't real: I can do that function using the wizards in Access (With some minimal code in the VB window... minimum like [Field1] = left([Combo3],4) and then setting Field1's record Source to "TableDB_ID" and Combo3's source to "TableID_Name"... The probem is, that's not really code... that's using the Properties tag on things... which means I'm pretty limited on what I can do...

    So I guess I need a "real world" assessment on how some of this VB101 is related to Access so that I can get a grip.... I can rote learn "You must put "snergle" in front of every other word on alternating Tuesdays"... but when things blow up in my code, I can't intellegently debug... it could be any one of those "Snergles" in the code at fault.

  4. #4
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Well here is something were you can start http://www.w3schools.com/ this is an online tutorial on various computer related subjects including VB Script. I often refer this tutorial to my students. Concepts are explained very well in simple language unlike text books and it provide lot of examples. It even gives you tests so that that you can evaluate your progress.

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

Similar Threads

  1. Learning Access...need help.
    By Banner in forum Queries
    Replies: 1
    Last Post: 10-12-2009, 02:48 AM

Tags for this Thread

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