Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Create a linked field or Zoom field

Posted on 2011-02-16
11
Medium Priority
?
345 Views
Last Modified: 2012-05-11
I have a field in RMA Entry Update window that display the related Work Order or RTV Number I would like to be able to click on this field and open the proper work order or RTV .
how can I accomplish that ?
Thanks
0
Comment
Question by:taverny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 34911863
In Modifier, create a button under the label of the RTV/WO #, add it to VBA, then hide it. For the label to look blue and underlined (like a link), select the label and set the property Zoom to True.
Add your code to the Button_Changed() event to open the respective transaction.
0
 

Author Comment

by:taverny
ID: 34912219
ok I was able to create a button and hide it. but I am confuse is how to tell the button depending of the data that inside my field to open the correct form and pass the field info . I would like to do somehting like that :
if the field has a WO#  then call WorkOrderEntryupdate window with This WO #.
else if it is a RTV # call the RTV window with RTV #
else if empty or not matching RTV or WO  don't do anything.
0
 

Author Comment

by:taverny
ID: 34912264
ok here is an update and approach I got and seems to work but how I do pass the WO# from my current window.

    If Left(StrWORTVNum.Value, 3) = "WRK" Then
    WorkOrderEntryUpdate.Open

    End If
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

by:taverny
ID: 34912338
Well I think I got it. can you please tell me if this code is good enough? or I should be carrefull with something?
thank you

Private Sub ButWoRTVLookup_Changed()

    If Left(StrWORTVNum.Value, 3) = "WRK" Then
        WorkOrderEntryUpdate.Open
        WorkOrderEntryUpdate.WorkOrderNumber = StrWORTVNum.Value
    End If  
    If Left(StrWORTVNum.Value, 3) = "RTV" Then
        RTVEntryUpdate.Open
        RTVEntryUpdate.RTVNumber = StrWORTVNum.Value
    End If
   
End Sub
0
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 34912427
Your code is not bad, but I prefer searching for the StrWORTVNum in the RTV table, if it's not existed then search for it in the WorkOrder table and respond accordingly.

I'm suggesting to search in the WorkOrder table after searching in the RTV table for your code concistency, but you can do something like this:

' Search RTV table
If found in RTV table then
   RTVEntryUpdate.Open
   RTVEntryUpdate.RTVNumber = StrWORTVNum.Value
Else
   WorkOrderEntryUpdate.Open
   WorkOrderEntryUpdate.WorkOrderNumber = StrWORTVNum.Value
End If
0
 

Author Comment

by:taverny
ID: 34917446
I think you are right , your approach seems better but since the field is populated if the record exists in either of the table then I should be safe to go directly with the field opening the RTV or WO if the field is not empty.
0
 
LVL 10

Accepted Solution

by:
Abdulmalek_Hamsho earned 2000 total points
ID: 34917570
In this case, you can but a flag (Boolean IsRTV) and set it to true if you found the record in RTV table, otherwise, IsRTV = False if found in WO table. And do this:

If IsRTV then
   RTVEntryUpdate.Open
   RTVEntryUpdate.RTVNumber = StrWORTVNum.Value
Else
   WorkOrderEntryUpdate.Open
   WorkOrderEntryUpdate.WorkOrderNumber = StrWORTVNum.Value
End If

The purpose is not to issue two SQL statement to the server, one to decide what's the RTV/WO #, and the next to make sure it's existed.

Your  Left(StrWORTVNum.Value, 3) = "WRK" command is not generic, because it won't work if the Trx Prefix was WO even if you can ensure that your Trx prefix is 3 chars long and either starts with WRK or RTV.
0
 

Author Comment

by:taverny
ID: 34917820
I am sorry I lost you there.

Everytime that my window loads for an RMA line it looks in the table to pull the SVC_Document_Number (which is my RTV/WO #) and put it in the strWORRTVNum field of my screen( just to be clear , the strWORRTVNum is a field on my RMA and not on my table) .and my user can't modify anyway. so either it has an RTV000000 or WO000000 or just empty but can't be anything else.
so if I do a test on the field to be RTV or WRK then I should be safe , anything else would be that it doesn't exists. and those prefix are always gonna be RTV or WRK

am I missing something?
0
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 34918103
I know, but in future, your company many change the prefix of the trx, in this case you would need to alter your code. I always recommend being generic in your code.
0
 

Author Comment

by:taverny
ID: 34918369
I understand , well I know it would be poor programming , I guess I will leave it like that for now and modify it in the future since I really doubt we will ever change it .
but thank you for your concerns
0
 

Author Comment

by:taverny
ID: 34928683
Hi,
 Just wanted to let you know I just open a new question that I think you are the most familiar with my code.
Thanks
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
Desired Skill Set for Microsoft Dynamics CRM Technical Resources – Part I
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question