Can we create new table base on subform query

rio

Registered User.
Local time
Today, 07:06
Joined
Jun 3, 2008
Messages
124
hi.

in my form I used 2 combobox to show and hide column in subform. so can I make new table for this subform (only show column)

This is my combo code :

Code:
Private Sub hideColumn_Change()
    Select Case Me.hideColumn
    Case "Test 1"
        Me.Subform.Form.Test1.ColumnHidden = True
    Case "Test 2"
        Me.Subform.Form.Test2.ColumnHidden = True
    Case "Test 3"
        Me.Subform.Form.Test3.ColumnHidden = True
    End Select
End Sub

Private Sub showColumn_Change()
    Select Case Me.showColumn
    Case "Test 1"
        Me.Subform.Form.Test1.ColumnHidden = False
    Case "Test 2"
        Me.Subform.Form.Test2.ColumnHidden = False
    Case "Test 3"
        Me.Subform.Form.Test3.ColumnHidden = False
    End Select
End Sub

:confused::confused:
 
I would dynamically build the SQL string to use in a make table query.

Why not just hide controtls on he subform?
 
hi.

in my form I used 2 combobox to show and hide column in subform. so can I make new table for this subform (only show column)

This is my combo code :

Code:
Private Sub hideColumn_Change()
    Select Case Me.hideColumn
    Case "Test 1"
        Me.Subform.Form.Test1.ColumnHidden = True
    Case "Test 2"
        Me.Subform.Form.Test2.ColumnHidden = True
    Case "Test 3"
        Me.Subform.Form.Test3.ColumnHidden = True
    End Select
End Sub

Private Sub showColumn_Change()
    Select Case Me.showColumn
    Case "Test 1"
        Me.Subform.Form.Test1.ColumnHidden = False
    Case "Test 2"
        Me.Subform.Form.Test2.ColumnHidden = False
    Case "Test 3"
        Me.Subform.Form.Test3.ColumnHidden = False
    End Select
End Sub
:confused::confused:
Also, duplication of data. Can you not create a SELECT query to extract that column only?

Unless you have your reasons why you want to build a new table for that column?
 
my plan is to create graph from that selection subform. i want the graph only show the select column. so what i know is....to make a graph we have to link it with a table. that why i want to make new table.

so...
llkhoutx and vbaInet..... any suggestion?
 
What you're doing is hiding the column in the Datasheet VIEW not the record source. You need to devise a way of hiding the field instead. Think about sql, think about recordsets, think about INSERT.
 
Thanks...vbaInet
I solved it by using this code.
Code:
Private Sub Command9_Click()
Dim sqlStr As String

sqlStr = "SELECT " & "Table1.Test" & ", " & "Table1." & Me!Test 1 & ", " & "Table1." & Me!Test 2 & " INTO " & "Tablelain " & "FROM " & "Table1;"
DoCmd.SetWarnings False
DoCmd.RunSQL sqlStr
DoCmd.SetWarnings True

End Sub
 
I knew you had the prowess to come up with a solution from the ideas given.

Great job rio.
 

Users who are viewing this thread

Back
Top Bottom