+ Reply to Thread
Results 1 to 3 of 3

Thread: Select Record in form by referencing Integar

  1. #1
    Forum Contributor
    Join Date
    09-23-2007
    Posts
    109

    Wink Select Record in form by referencing Integar

    Does anyone know how to select a record in a form by using an integar.

    I can change a textbox to contain the record number by using the below code

    me.text1 = me.form.CurrentRecord
    But I can't change the record in the form by using a record number.

    I would have thought that it would go something like the below but it looks like a 'Record' property doesn't exist. Anyone know if there is a way of doing this? I'm using Access 2002.

    Me.form.record = text1.value
    Thanks.
    Last edited by danny2000; 07-21-2011 at 04:38 AM.

  2. #2
    Forum Guru davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2007
    Posts
    1,879

    Re: Select Record in form by referencing Integar

    You need to use SQL or VBA with recordsets to update the underlying value. In general, a SQL statement will be easiest, something like this:

    UPDATE your_table SET yourfield=text1.value WHERE table_id_field=record_id
    You can execute this in VBA by using the DoCmd.RunSQL method.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Forum Contributor
    Join Date
    09-23-2007
    Posts
    109

    Re: Select Record in form by referencing Integar

    Dave, thanks very much. Good solution too.

    I'll definitely use that. Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0