Re: Convert to PDF

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




I'm not real sure where to find the answer to your question...
are you talking about in Tools- refrences?... or in the code itself...

I didn't write the code, I just copied it... it works in one of my othe db,
without a problem, I don't know why it won't work in this particular db
--
-Jacinda


"Douglas J. Steele" wrote:

Do you have a reference set to DAO?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jacinda" <Jacinda@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:90B78053-3A90-49AB-A20B-F93B24C7A101@xxxxxxxxxxxxxxxx
"Compile error: User-defined type not defined"
--
-Jacinda


"Daniel Pineault" wrote:

' I keep getting an error', what does the error say exactly?

--
Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"Jacinda" wrote:

Hi, I imported this from http://www.lebans.com/reporttopdf.htm... this
is
just a piece of the code... I keep getting an error on this part of the
code:

Public Function TdfSetOk(db As DAO.Database, tdf As DAO.TableDef, ctl
As
Control, strErrMsg As String) As Boolean
On Error GoTo Err_Handler
'Purpose: Set the TableDef passed in, using the name in the
Caption in
the control's attached label.
'Return: True on success. (Fails if the caption is an alias.)
'Arguments: db = database variable (must already be set).
' tdf = the TableDef variable to be set.
' ctl = the control that has the name of the table in its
attached label.
' strMsg = string to append any error messages to.
Dim strTable As String 'The name of the table.

strTable = ctl.Controls(0).Caption 'Get the name of the table from
the
attached label's caption.
Set tdf = db.TableDefs(strTable) 'Fails if the caption is an
alias.
TdfSetOk = True 'Return true if it all worked.

Exit_Handler:
Exit Function

Err_Handler:
Select Case Err.Number
Case 3265& 'Item not found in collection. (Table name is an
alias.)
strErrMsg = strErrMsg & "Skipped table " & strTable & vbCrLf
Case Else
strErrMsg = strErrMsg & "Error " & Err.Number & ": " &
Err.Description & vbCrLf
End Select
Resume Exit_Handler
End Function
--

I have used the whole code in another database with success, but now
when I
tried it in another db I am having a problem... I'm confused about what
label
name this is referring to... Help :-)
-Jacinda



.



Relevant Pages

  • RE: Convert to PDF
    ... the control's attached label. ... (Fails if the caption is an alias.) ... Set tdf = db.TableDefs'Fails if the caption is an alias. ...
    (microsoft.public.access.modulesdaovba)
  • Convert to PDF
    ... the control's attached label. ... (Fails if the caption is an alias.) ... Set tdf = db.TableDefs'Fails if the caption is an alias. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Convert to PDF
    ... I see no point in adding a DAO reference just to satisfy some declarations ... Set the TableDef passed in, using the name in the Caption ... the control's attached label. ... Set tdf = db.TableDefs'Fails if the caption is an alias. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Convert to PDF
    ... "Daniel Pineault" wrote: ... the control's attached label. ... (Fails if the caption is an alias.) ... Set tdf = db.TableDefs'Fails if the caption is an alias. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Convert to PDF
    ... If you are using Office 2007, you can just download the Office add-in "Save ... (Fails if the caption is an alias.) ... Set tdf = db.TableDefs'Fails if the caption is an alias. ...
    (microsoft.public.access.modulesdaovba)