By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,726 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

MS Access Not Displaying Fields on Form

P: 1
MS Access 2002 SP 3

I have two forms, one with a combo box looking at available lookup tables and the other an unbound form which will be used by the user to update lookup values.

The lookup value tables all have the same format: ID, Value, ValidFrom, ValidTo

The code I use to get the form to look at the correct lookup value table is:

Dim db As Database
Dim tdfTable As TableDef
Dim strTableName As String

strTableName = Me![cmbLookupTables].Value

Set db = CurrentDb()
Set tdfTable = db.TableDefs(strTableName)

If IsNull(Me![cmbLookupTables]) Then
MsgBox "No selection."
Else


DoCmd.OpenForm "frmLookUpTablesAdministration"

'Get the fields for the SQL query
Dim strID As String
Dim strValue As String

strID = tdfTable.Fields(0).Name
strValue = tdfTable.Fields(1).Name

Forms!frmLookUpTablesAdministration.Caption = "Edit List for " & Me![cmbLookupTables].Column(1)


Forms![frmLookUpTablesAdministration].RecordSource = "SELECT [" & strID & "] AS tblID,[" _
& strValue & "] AS tblDescription,[" _
& strValidFrom & "],[" _
& strValidTo & "]" _
& " FROM " & strTableName & ";"
Forms![frmLookUpTablesAdministration].Requery
Forms!frmLookUpTablesAdministration.Repaint
Forms!frmLookUpTablesAdministration.Refresh
End If


The values on the edit form are being set correctly and the correct number of records returned. However, the fields are not visible (have checked the visible property is set to yes) even though in the properties window I can scroll through each field and check the properties have been set correctly.

Any ideas where I am going wrong?
Oct 26 '06 #1
Share this Question
Share on Google+
1 Reply


PEB
Expert 100+
P: 1,418
PEB
Hi,

You need to set the control properties of your fields to visualize your data..

Each field has own name!

So

Me!Field1.ControlSource=/the name of the field from your table def/


:)
Oct 27 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.