Hi Sheila,
in order to help you,we need to know your data structure. Here is
something you can do to document that for us:
create a new general module
paste in this code:
'~~~~~~~~~~~~~~~~~~
'NEEDS REFERENCE to Microsoft DAO library
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'TO DOCUMENT -->
'--- click your mouse into the appropriate Sub below
'--- press F5 to run
Sub RunShowFieldsForTable()
'edit this line for the tablename you wish to document
ShowFields "Your tablename"
End Sub
Sub RunShowFieldsForAllTables()
Dim i As Integer _
, mTablename As String
For i = 0 To CurrentDb.TableDefs.Count - 1
mTablename = CurrentDb.TableDefs(i).Name
If Left(mTablename, 4) <> "Msys" Then
Debug.Print 'blank line
ShowFields mTablename
End If
Next i
End Sub
'~~~~~~~~~~~~~~~~~~
Sub ShowFields(pstrTable As String)
'by DuaneHookom
'modified by Crystal
Dim fld As DAO.Field
Dim tbl As DAO.TableDef
Dim db As DAO.Database
Set db = CurrentDb
Set tbl = db.TableDefs(pstrTable)
Debug.Print tbl.Name
Debug.Print "=========================="
For Each fld In tbl.Fields
'modified by Crystal
Debug.Print fld.OrdinalPosition & " " & fld.Name _
& ", " & fld.Type & " (" & GetDataType(fld.Type) & ")" _
& ", " & fld.Size
Next
'release object variables
set fld = nothing
set tbl = nothing
set db = nothing
End Sub
'~~~~~~~~~~~~~~~~~~
Function GetDataType(pDatType) As String
'by Crystal
Select Case pDatType
Case 1: GetDataType = "Boolean"
Case 2: GetDataType = "Byte"
Case 3: GetDataType = "Integer"
Case 4: GetDataType = "Long"
Case 5: GetDataType = "Currency"
Case 6: GetDataType = "Single"
Case 7: GetDataType = "Double"
Case 8: GetDataType = "Date"
Case 10: GetDataType = "Text"
Case 12: GetDataType = "Memo"
Case Else: GetDataType = Format(Nz(pDatType), "0")
End Select
End Function
'~~~~~~~~~~~~~~~~~~~~~~~~~
then
Debug, compile
click in the RunShowFieldsForAllTables sub
press the F5 key to run
then press CTRL-G to show the debug window
copy the results and paste into a Reply to this thread
Warm Regards,
Crystal
Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace
*
(: have an awesome day :)
*
> I am (trying!) to build a database for a dance school that is putting on a
> big show. A bit of a huge undertaking considering I have NEVER used Access
[quoted text clipped - 40 lines]
>
> Thanks, Sheila
Sheila - 19 May 2008 23:33 GMT
Hi Crystal,
Many thanks for taking the time to reply, but I'm afraid I'm not advanced
enough to understand what you are asking me to do. In any case, many hours
later, I think I may have found the answer...sort of...
I managed to produce a form whereby I entered the track name, then the
remaining fields were automatically completed (eg dance type,
teacher/choreographer etc). I used a combo box.
But, all worked ok until I then added another field with the student name.
It would seem that because the original info was coming from x1 table, the
moment I then added another field, it upset the balance and I could no longer
autopopulate the fieds particular to the track/dance itself.
Am I making any sense at all......
Thanks, Sheila
> Hi Sheila,
>
[quoted text clipped - 142 lines]
> >
> > Thanks, Sheila
strive4peace - 19 May 2008 23:54 GMT
Hi Sheila,
"I'm afraid I'm not advanced enough to understand what you are asking me
to do."
read this:
Access Basics (on Allen Browne's site)
http://www.allenbrowne.com/casu-22.html
8-part free tutorial that covers essentials in Access
Allen has a wealth of information on his site; after you get to the
bottom of this link, click on 'Index of Tips'
"all worked ok until I then added another field with the student name"
if you are collecting the StudentID, there is no need to include the
table of Students in the RecordSource for your form; you can simply use
a combo for the studentID and let the RowSource of the combo get
information from the Students table (read the Combobox example in
'Access Basics')
each form/subform should be based on just one table
Warm Regards,
Crystal
*
(: have an awesome day :)
*
> Hi Crystal,
>
[quoted text clipped - 161 lines]
>>>
>>> Thanks, Sheila