Synching list with fields
Synching list with fields
am 01.05.2007 03:25:38 von John
Hi
I have a form which is bound to a query with some bound controls. On the
same form I also have a list bound to the same query. How can I sync the
controls on the form with the list such that when a list item is selected by
user the controls on the form move to the same record?
Thanks
Regards
Re: Synching list with fields
am 01.05.2007 04:49:01 von Tom van Stiphout
On Tue, 1 May 2007 02:25:38 +0100, "John"
wrote:
The list control should be unbound.
In its AfterUpdate event write:
With Me.RecordsetClone
.FindFirst "[ID] = " & Me![myListControl]
Me.Bookmark = .Bookmark
End With
-Tom.
>Hi
>
>I have a form which is bound to a query with some bound controls. On the
>same form I also have a list bound to the same query. How can I sync the
>controls on the form with the list such that when a list item is selected by
>user the controls on the form move to the same record?
>
>Thanks
>
>Regards
>
Re: Synching list with fields
am 02.05.2007 18:45:12 von villarreal68
I agree with Tom. You need the fields on the form to be "Unbound" or
not linked to any fields in any table/query.
But since I'm fairly new to Access and I don't know much VBA yet, I
do the population of the "Unbound" fields a bit different. So I would
do it the way Tom describes below.
On Apr 30, 7:49 pm, Tom van Stiphout wrote:
> On Tue, 1 May 2007 02:25:38 +0100, "John"
> wrote:
>
> The list control should be unbound.
>
> In its AfterUpdate event write:
>
> With Me.RecordsetClone
> .FindFirst "[ID] = " & Me![myListControl]
> Me.Bookmark = .Bookmark
> End With
>
> -Tom.
>
>
>
> >Hi
>
> >I have a form which is bound to a query with some bound controls. On the
> >same form I also have a list bound to the same query. How can I sync the
> >controls on the form with the list such that when a list item is selected by
> >user the controls on the form move to the same record?
>
> >Thanks
>
> >Regards- Hide quoted text -
>
> - Show quoted text -
Re: Synching list with fields
am 03.05.2007 03:33:28 von Tom van Stiphout
On 2 May 2007 09:45:12 -0700, villarreal68@yahoo.com wrote:
I disagree with villareal68. For my code to work the form must be
bound. ONLY the list control should be unbound.
As a rookie you should probably not work with unbound forms. It's not
what Access is primarily designed to do. If you go unbound, you better
have a good reason, and more than beginners knowledge of VBA.
-Tom.
>I agree with Tom. You need the fields on the form to be "Unbound" or
>not linked to any fields in any table/query.
>
>But since I'm fairly new to Access and I don't know much VBA yet, I
>do the population of the "Unbound" fields a bit different. So I would
>do it the way Tom describes below.
>
>
>
>On Apr 30, 7:49 pm, Tom van Stiphout wrote:
>> On Tue, 1 May 2007 02:25:38 +0100, "John"
>> wrote:
>>
>> The list control should be unbound.
>>
>> In its AfterUpdate event write:
>>
>> With Me.RecordsetClone
>> .FindFirst "[ID] = " & Me![myListControl]
>> Me.Bookmark = .Bookmark
>> End With
>>
>> -Tom.
>>
>>
>>
>> >Hi
>>
>> >I have a form which is bound to a query with some bound controls. On the
>> >same form I also have a list bound to the same query. How can I sync the
>> >controls on the form with the list such that when a list item is selected by
>> >user the controls on the form move to the same record?
>>
>> >Thanks
>>
>> >Regards- Hide quoted text -
>>
>> - Show quoted text -
>
Re: Synching list with fields
am 12.11.2007 16:16:18 von Asgeir Nesoen
Private Sub cmbUserinput_AfterUpdate()
if (not isnull(me!cmbUserinput)) then
me.recordsetclone.findfirst "targetfield=" & str(cmbUserinput.Value)
if (not me.recordsetclone.nomatch) then
me.bookmark = me.recordsetclone.bookmark
else
msgbox "No record found..."
end if
end if
end sub
--A--
On 01.05.2007 03:25, John wrote:
> Hi
>
> I have a form which is bound to a query with some bound controls. On the
> same form I also have a list bound to the same query. How can I sync the
> controls on the form with the list such that when a list item is selected by
> user the controls on the form move to the same record?
>
> Thanks
>
> Regards
>
>