Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show different columns in cbo box in different forms

Status
Not open for further replies.

shy216

Programmer
Jul 21, 2005
142
0
0
US
i've linked 2 cbo boxes from different forms.
so from form 1 if user selects OK, it opens form 2
and that record shows up on form 2 as well.
problem is i need to show different column on the form 2.
i.e. if first combo box contains 2 colums,
"Name", and "Number". (but only shows "name" from
form 1). when user selects from cbo and clicks ok.
then Form 2 opens up and on that cbo, "number"
needs to show up.
does that make sense? so pretty much second one must bring
all the info from the first cbo but only show different column as the first cbo.
 
By setting different column widths for the combo on form 2?
Form 1
Column Widths: 0; 2.5

Form 2
Column Widths: 2.5; 0
 
is it because i used this coding?

Forms!frm1_PurRequisition!cboGA = Me!cboGA

i see how u'r suggestion will work but..

not working on me.
 
It worked for me ... :-(

I had
[tt]Private Sub Form_Load()
Me.Combo0 = Forms!frmForm1.Combo0
End Sub[/tt]

In what way is it not working?
 
well first, this is what i have.

row source:
SELECT tbl_PurchaseAuthority.[General Authorities], tbl_PurchaseAuthority.[Washington Purchasing Manual], tbl_PurchaseAuthority.[GA Num] FROM tbl_PurchaseAuthority ORDER BY tbl_PurchaseAuthority.[General Authorities];
width:3;0;0;

coding..>
Private Sub Select_Click()
On Error GoTo err_select_click

Dim stdocname As String
Dim stlinkcriteria As String

DoCmd.OpenForm "frm1_PurRequisition"
Forms!frm1_PurRequisition!cboGA = Me!cboGA

Exit_select_click:
Exit Sub

err_select_click:
MsgBox Err.Description
Resume Exit_select_click

End Sub

combo box is showing blank...

 
I tried something similar to the above, and it still works. This was working before you changed the column widths, right? So is it possible that tbl_PurchaseAuthority.[General Authorities] is empty? [ponder]
 
i tried starting over but it's still not working on me... can it be because im using the command button?
 
No, I don't think so, in my original test I use a command button. What happens if you change the column widths to say, 0;0;3?
 
Can you post some sample data from tbl_PurchaseAuthority? The combo was working in the first place wasn't it? What happens if you go back to the original column widths?
 
no no, it didnt work from before...

General Authorities | WPM | GA Num
desing or artwork | gd | G.4.j
OEM repair serv | oem | G.4.k
Technical inspect | techin | G.4.l

here are the sample data.

so the first cbo needs to list "General Authorities," which is working fine, and second cbo needs to query "GA Num."

i've tried using just 2 columns but still wouldnt work...
 
Ok. Do you need the second form? Would putting the answer (ie GA Num) in a textbox on form 1 suit?
Second idea. Check the names of everything. For example, what happens when you type Me. (me dot)? Does cboGA show as an option in the intellisense list?
Third idea. Create a blank form and cut and paste the combo box from form 1 (that is working) to this new form. Let's say you call the new form frmTest. Add a command button to Form 1 to open the frmTest and add your line of code:
Forms!frmTest.cboGA = Me.cboGA
After the form open statement (as above).

 
no.. it must show up on the second form. and yes cboGA does show as an option in the intellisense list... im gonna try it again on a blank form.. thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top