PC Review


Reply
Thread Tools Rate Thread

After update issue

 
 
dab1477
Guest
Posts: n/a
 
      21st Oct 2008
I have redirected this post from Coding to here...

I have a subform titled NewPartsSubForm. Within this form, I have a combo box
labled as Rtg_oper_num. I am able to choose from a listing of routings within
the box (I choose 100, 120, 140, 32156 etc from a listing). I want to
populate a Description filed within this same subform based upon the entry I
choose in the Rtg_oper_num field. I have a table call Operations, where I
have the operation number in one column and the operation descripton in an
adjacent column. I am trying to lookup the Rtg_oper_num entry on the subform;
match it to the Operation Number in the Operations table, and return the
Operation Description from the Operations table to the Description field on
the subform. At this point I have the following Afterupdate coded for the
Rtg_Oper_num field in the subform;
if RTG_OPER_num>0 then
me.oper_desc.value=DLookUp("[Oper_Desc]","[operations]","[rtg_oper_num]=Forms![newpartsubform]![rtg_oper_num]")
End if
End Sub

At this point I get the SAME value for all Decription Fields regardless of
the value of the RTG_oper_num field. Where am I going wrong? Thanks.

I'm fairly new to VBA. Your patience is appreciated.
 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      21st Oct 2008
dab1477 wrote:

>I have redirected this post from Coding to here...
>
>I have a subform titled NewPartsSubForm. Within this form, I have a combo box
>labled as Rtg_oper_num. I am able to choose from a listing of routings within
>the box (I choose 100, 120, 140, 32156 etc from a listing). I want to
>populate a Description filed within this same subform based upon the entry I
>choose in the Rtg_oper_num field. I have a table call Operations, where I
>have the operation number in one column and the operation descripton in an
>adjacent column. I am trying to lookup the Rtg_oper_num entry on the subform;
>match it to the Operation Number in the Operations table, and return the
>Operation Description from the Operations table to the Description field on
>the subform. At this point I have the following Afterupdate coded for the
>Rtg_Oper_num field in the subform;
>if RTG_OPER_num>0 then
>me.oper_desc.value=DLookUp("[Oper_Desc]","[operations]", _
> "[rtg_oper_num]=Forms![newpartsubform]![rtg_oper_num]")
>End if
>End Sub
>
>At this point I get the SAME value for all Decription Fields regardless of
>the value of the RTG_oper_num field. Where am I going wrong? Thanks.



If you are using a continuous or datasheet form, seeing the
same value on each row is the way it works when you set an
unbound control's value using code.

BTW, you do not need to use code to display the description.
If the combo box's row source query includes the description
in the second column, then the Oper_Desc text box can
display the description by using this expression:
=Rtg_Oper_num.Column(1)

To get the related value on each row, you can use DLookup in
the text box's control source:
=DLookup("Oper_Desc","operations","rtg_oper_num=" &
rtg_oper_num")

BUT that can easily be too slow to be useful.

--
Marsh
MVP [MS Access]
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless issue? DNS issue? MS Update issue? WORLDe Windows XP General 1 14th Jan 2009 10:47 PM
Update issue =?Utf-8?B?VG9t?= Spyware Announcements 4 19th Mar 2006 04:28 AM
SQL Update issue =?Utf-8?B?R0w=?= Microsoft Access Form Coding 2 13th Feb 2006 09:31 PM
PROBLEM: W2K Restarting randomly - NOT a hardware issue - UPDATE issue Bat Microsoft Windows 2000 4 7th Aug 2003 10:13 PM
update on this issue Glen Microsoft Outlook Calendar 0 4th Aug 2003 07:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:28 AM.