Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Thu, 26 Jun 2008 10:38:04 -0700 (PDT),    group: microsoft.public.access.modulesdaovba.ado        back       


Click on a detail record field, reference the record?   
I click on a detail record field in a form, and want to reference
other fields in that same record. In the OnClick handler, I can easily
see the field text value, and the Me.CurrentRecord number, like so:

Private Sub Tset_Click()
    ' I can see the text of the cell I clicked on (tset) fine.
    ' I can reference the current record in the grid fine too. (it's
record 12)
    MsgBox "Tset field value is " & Tset.Text & ", current detail
record is  (" & Me.CurrentRecord & ")"

    ' now how do I reference other cells on the same grid row?
    Dim rs As ADODB.Recordset
    Set rs = Me.Recordset          ' gives an error too
    Set rs = Me.RecordsetClone  ' gives a type mismatch error
    'MsgBox "The LType field is " & rs!LType    ' I don't get this far
End Sub

Any help would be appreciated. I have read about RecordSetClone
requires the use of DAO, but that is a whole other project for me to
learn about. Is there any easier way to reference a record row in a
detail grid on a form? Thanks
date: Thu, 26 Jun 2008 10:38:04 -0700 (PDT)   author:   unknown

Re: Click on a detail record field, reference the record?   
hi Kevin,

kevinwjameson@gmail.com wrote:
> I click on a detail record field in a form, and want to reference
> other fields in that same record. 
You can easily access these fields with

   Me![fieldName]

You don't need to specify the control bound to the field.


mfG
--> stefan <--
date: Thu, 26 Jun 2008 20:03:42 +0200   author:   Stefan Hoffmann

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us