Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Loop

  • 10-07-2000 3:20pm
    #1
    Registered Users, Registered Users 2 Posts: 1,643 ✭✭✭


    Ok - I need a Loop. This is yet again the SQL MS Access thing. (Ta for the suggestion by the way)

    Now what I can gather is I need to put together something like this;

    DO WHILE val <>0

    {Code bits}

    LOOP

    So like was suggested It'll end when I enter a zero.

    Question is - What else do I need to do? Modules? Extra Code?

    Are the code bits just the ...
    Select from blah blah If bits are in String (not wishing to blind you with technical jargon)

    Whats this "Dim" thing I see in the examples?
    If Loop is an SQL cmnd thing that i put into the query in SQL view, then is there a need for a macro?

    Ta muchly,

    JAK.



Comments

  • Closed Accounts Posts: 102 ✭✭OctaviaN


    Another SQL Prob?

    Is this for work?
    Did ya go into college??ah that was a stupid one no students go to college.

    You might need an Inputbox thing!!for the prompt? to go with the "SQL cmnd thing".

    soz man i cant really remember any of my programming talents...hang on did i have any?
    someones sure to reply!
    I was just a bit bored smile.gif gl


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    ffs.. RTFM.

    Next we'll have people posting thier homework on the humanities board.



  • Registered Users, Registered Users 2 Posts: 2,660 ✭✭✭Baz_


    Hey man I'm not really sure what you are up to but when you use MS Access, and especially the way you are suggesting, you don't use pure SQL, but a VBA with a little sql thrown in for the good stuff.

    Most of your questions are fundamental questions about the visual basic language and because of that I'm going to assume you have never attended a class on programming in your life (if you have it wasn't in VB anyway). If you have tell me what language you used, as if it was c you used it would be easier to explaining.

    Right a loop in any programming language allows you to repeat the same lines of code over and over until the condition becomes false.

    In your code the condition is "val <>0"
    which in english means val is not equal to 0, so while thats true, your loop will loop.

    I don't know what extra bits you mean but yes I think the code bits are the select from blah blah lines.

    About dim, it is setting aside a space in memory for a variable to be stored, or declaring a variable.

    i.e.
    dim val as integer,
    declares val as an integer variable and sets aside a protected area in memory for the variable.

    The rest someone else will have to answer.


  • Registered Users, Registered Users 2 Posts: 861 ✭✭✭Slosh


    Andy,

    Mail me the MDB and pop over and we'll do it and have a beer... (brought by you smile.gif )


  • Registered Users, Registered Users 2 Posts: 1,643 ✭✭✭Jak


    Done.


  • Advertisement
Advertisement