Results 1 to 9 of 9

Thread: quick access/vb problem...

  1. #1
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb

    quick access/vb problem...

    well maybe quick.

    basically, i have a form :



    and i need those little '>' and '<' to move the individual records back and forward (they arent directly related tables)...

    basically, if i use the little navigation thing access puts on their by default, the bottom (teacher) records move, but this isnt useful.

    i've looked at the code and its :

    DoCmd.GoToRecord , , acNext

    which is nice. but i want 3 individual ones to move each record (subject / teacher / room) individually.. and i seem to be getting nowhere. i looked on google, but it gives lots of examples of the "DoCmd.GoToRecord , , acNext" command, but not for what i want to do...

    can anyone please help ?



    mark

    edit : corrected [img] tags
    Last edited by streetster; 10-11-2003 at 06:32 PM.

  2. #2
    Senior Member Shad's Avatar
    Join Date
    Jul 2003
    Location
    In front
    Posts
    2,782
    Thanks
    23
    Thanked
    42 times in 25 posts
    If you're using ADO...

    objRecordSet.MoveNext and similarly objRecordSet.MovePrevious will increment and decrement a record set between records.
    Simon


  3. #3
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb
    ADO? i am using Microshaft Access XP... the command to move forward and back is DoCmd.GoToRecord , , acNext (or acBack), i know that much. but i need to apply it to a specific field...

    mark

  4. #4
    Senior Member Shad's Avatar
    Join Date
    Jul 2003
    Location
    In front
    Posts
    2,782
    Thanks
    23
    Thanked
    42 times in 25 posts
    Read up on ADO (ActiveX Data Objects). I suspect it is what Access has given you to use anyway (i.e. that's what it's using in the existing code).
    Simon


  5. #5
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb
    i dont want to go into ADO stuff, as i'm sure it should be possible with just plain VB (no need to over complicate the situation)..

    so far i have got this bit of code :

    DoCmd.GoToControl "room_no"
    DoCmd.GoToRecord acDataForm, "Room_No", acNext
    which tells me that "the object 'Room_No' isn't open"

    or

    DoCmd.GoToControl "room_no"
    DoCmd.GoToRecord acDataForm, Room_No, acNext
    which tells me 'The object 'M1' is not open..

    how the hell do i 'open' either object so this stupid thing will work?

    the 'gotocontrol' bit moves the cursor into the correct field, however thats as far as i get.. i'm really annoyed with stupid access now, as its really not a hard thing, but i cant do it

    mark

  6. #6
    Member
    Join Date
    Aug 2003
    Location
    Wimbledon
    Posts
    141
    Thanks
    0
    Thanked
    0 times in 0 posts
    Try createing 3 sub forms, one for room, one for subject, one for teacher. Set the datasource of each sub-form to the correct table.

    Create a 4th form which hosts all 3 sub forms. The next and prev commands will now work as each subform has a table behind it.

    It's not neat but since you don't want to learn ADO.....

    Mart

  7. #7
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb
    kinda followed your advice, as i have no idea where to start with ADO - isnt that a bit ott for an a2 project? perhaps, i dont know.. but still, i've made 3 forms, and then made a 4th which has 3 subforms (well it will do eventually, got 1 so far), seems to be working so far tho

    mark

  8. #8
    Senior Member Shad's Avatar
    Join Date
    Jul 2003
    Location
    In front
    Posts
    2,782
    Thanks
    23
    Thanked
    42 times in 25 posts
    A2 Computing (I assume that's what your doing?) requires some form of programming to be used (certainly did when I did it). So making use of ADO (which is only a collection of objects after all) wouldn't be a bad idea...
    Simon


  9. #9
    cat /dev/null streetster's Avatar
    Join Date
    Jul 2003
    Location
    London
    Posts
    4,138
    Thanks
    119
    Thanked
    100 times in 82 posts
    • streetster's system
      • Motherboard:
      • Asus P7P55D-E
      • CPU:
      • Intel i5 750 2.67 @ 4.0Ghz
      • Memory:
      • 4GB Corsair XMS DDR3
      • Storage:
      • 2x1TB Drives [RAID0]
      • Graphics card(s):
      • 2xSapphire HD 4870 512MB CrossFireX
      • PSU:
      • Corsair HX520W
      • Case:
      • Coolermaster Black Widow
      • Operating System:
      • Windows 7 x64
      • Monitor(s):
      • DELL U2311
      • Internet:
      • Virgin 50Mb
    no i'm doing a2 philosophy.. yeh computing , hmm well i'll see if there are any books at college about it, but this is just a form, i have some harder parts which i'm sure you're more than capable of doing, which i will have to ask for peoples help with i think heh..

    mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •