UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Same Field Twice On A Form, Office 2010    
 
   
ehops
post Apr 11 2012, 10:29 AM
Post #1

UtterAccess Member
Posts: 25



I have a simple form to record defects on our material both at the beginning of the run and at the end. Let's call them DefectHeadCode and DefectTailCode. Our list of defects is long so I created a separate table for simplicity and maintainability. The Defects table just has the fields DefectCode and DefectDescription. I can't seem to get the Description to be specific on the form for both Head and Tail. I can't add the control to the form for both.

I have been successful at building code behind non-bound controls that does SQL calls for each, but I was wondering if there was anything more elegant using the native workings of Access.

Thank you for your time.

---eric
Go to the top of the page
 
+
Squire4Hire
post Apr 11 2012, 10:37 AM
Post #2

UtterAccess Guru
Posts: 731
From: North of the 49th Parallel



eric,

I'm not entirely sure I understand how you've set this up - but a thought occurs, are you explicitly stating which table each description is calling from? ie: [table1].[DefectDescription] & [table2].[DefectDescription]
Go to the top of the page
 
+
darnellk
post Apr 11 2012, 10:42 AM
Post #3

UtterAccess Veteran
Posts: 303
From: Edmonton, Alberta, Canada



Can you post a snapshot of the form?
Go to the top of the page
 
+
Peter46
post Apr 11 2012, 10:42 AM
Post #4

UtterAccess VIP
Posts: 7,394
From: Oadby Leics, UK



"Let's call them DefectHeadCode and DefectTailCode"

To see both you need two fields in your table, one for each.
Or else you use an unbound control for the Headcode and place the starting value into the control using code in the form current event.
Go to the top of the page
 
+
ehops
post Apr 12 2012, 09:55 AM
Post #5

UtterAccess Member
Posts: 25



I am not exactly sure how to upload things so I took a couple of screen shots. The "-entrylog" file shows the form. This form works because the Head and Tail Cut Defect Descriptions are unbound and I get the values in the background.

I am just wondering if there is a way to use the native functionality of Access to more elegantly and easily bring up the descriptions for both head and tail defects when two fields on the entry log table are pointing to the same external table
Go to the top of the page
 
+
Squire4Hire
post Apr 12 2012, 10:01 AM
Post #6

UtterAccess Guru
Posts: 731
From: North of the 49th Parallel



Deleted.

This post has been edited by Squire4Hire: Apr 12 2012, 10:01 AM
Go to the top of the page
 
+
darnellk
post Apr 12 2012, 10:13 AM
Post #7

UtterAccess Veteran
Posts: 303
From: Edmonton, Alberta, Canada



In your combo boxes, just make sure to include the "DefectDesc" field in the column next to the "DefectCd" field in your rowsource query. You don't have to make the "DefectDesc" column visible in your combo box, but then in the textbox next to the combo box you can reference the DefectDesc column by entering "=cboDefectHead.column(1)" with column(0) being the DefectCd.

Hope this makes sense.
Go to the top of the page
 
+
ehops
post Apr 12 2012, 04:49 PM
Post #8

UtterAccess Member
Posts: 25



HA!!!

That was perfect. I am learning new cool stuff every day. A much more elegant solution than my "bull in a china shop" sql call.

Thank you so much!

---eric
Go to the top of the page
 
+
ehops
post Apr 12 2012, 04:50 PM
Post #9

UtterAccess Member
Posts: 25



HA!!!

That was perfect. I am learning new cool stuff every day. A much more elegant solution than my "bull in a china shop" sql call.

Thank you so much!

---eric
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 04:07 PM