PC Review


Reply
Thread Tools Rate Thread

Db Link via code (Klatuu Help)

 
 
DDBeards
Guest
Posts: n/a
 
      29th Jul 2008
I had posted help back on 6/27 and got help back from Klatuu but need some
clarification.

Problem. I am trying to update links from a deveopment environment to a
production environement via code.

I have created "UTbl_Link" Table that has 33 records each with 3 fields:

TableName - contains the name of the table
ConnectString - contains the name and location of the mdb
ProdDev - contains a "D" or "P" for development or production

I have also created a form "UFrm_Rlink" that has a pull down box "PD_Box"
with two choices "P" or "D" and an execution button to run the code.

I am having problem with one line of code you supplied so I am sure I have
typed it wrong or translated it wrong. I have provided both what I was given
and what I have typed.

Your code
' Me.lblMsg.Caption = "Refreshing " & tdf.Name
' strNewPath = DLookup("[ConnectString]", "tblBeList", _
' "[TableName] = """ & tdf.Name & "" AND [ProdDev] = """ & _
' Me.txtEnvironment & """")


My code
Me.lblMsg.Caption = "Refreshing " & tdf.Name
strNewPath = DLookup("[ConnectString]", "UTbl_Link", _
"[TableName] = """ & tdf.Name & "" AND [ProdDev] = """ & _
Me.PD_Box & """")

the strNewPath line crahses. Please help

Thanks again

DDBeards
 
Reply With Quote
 
 
 
 
Paolo
Guest
Posts: n/a
 
      29th Jul 2008
Hi DDBeards,
I'm not Klatuu but I see the problem, you forgot a quotation marks. Try this

strNewPath = DLookup("[ConnectString]", "UTbl_Link", _
"[TableName] = """ & tdf.Name & """ AND [ProdDev] = """ & _
Me.PD_Box & """")

HTH Paolo

"DDBeards" wrote:

> I had posted help back on 6/27 and got help back from Klatuu but need some
> clarification.
>
> Problem. I am trying to update links from a deveopment environment to a
> production environement via code.
>
> I have created "UTbl_Link" Table that has 33 records each with 3 fields:
>
> TableName - contains the name of the table
> ConnectString - contains the name and location of the mdb
> ProdDev - contains a "D" or "P" for development or production
>
> I have also created a form "UFrm_Rlink" that has a pull down box "PD_Box"
> with two choices "P" or "D" and an execution button to run the code.
>
> I am having problem with one line of code you supplied so I am sure I have
> typed it wrong or translated it wrong. I have provided both what I was given
> and what I have typed.
>
> Your code
> ' Me.lblMsg.Caption = "Refreshing " & tdf.Name
> ' strNewPath = DLookup("[ConnectString]", "tblBeList", _
> ' "[TableName] = """ & tdf.Name & "" AND [ProdDev] = """ & _
> ' Me.txtEnvironment & """")
>
>
> My code
> Me.lblMsg.Caption = "Refreshing " & tdf.Name
> strNewPath = DLookup("[ConnectString]", "UTbl_Link", _
> "[TableName] = """ & tdf.Name & "" AND [ProdDev] = """ & _
> Me.PD_Box & """")
>
> the strNewPath line crahses. Please help
>
> Thanks again
>
> DDBeards

 
Reply With Quote
 
DDBeards
Guest
Posts: n/a
 
      29th Jul 2008
Thank you Paolo and Klatuu for your help, this is GREAT! and will save me
alot of time down the road.

DDBeards

"Paolo" wrote:

> Hi DDBeards,
> I'm not Klatuu but I see the problem, you forgot a quotation marks. Try this
>
> strNewPath = DLookup("[ConnectString]", "UTbl_Link", _
> "[TableName] = """ & tdf.Name & """ AND [ProdDev] = """ & _
> Me.PD_Box & """")
>
> HTH Paolo
>
> "DDBeards" wrote:
>
> > I had posted help back on 6/27 and got help back from Klatuu but need some
> > clarification.
> >
> > Problem. I am trying to update links from a deveopment environment to a
> > production environement via code.
> >
> > I have created "UTbl_Link" Table that has 33 records each with 3 fields:
> >
> > TableName - contains the name of the table
> > ConnectString - contains the name and location of the mdb
> > ProdDev - contains a "D" or "P" for development or production
> >
> > I have also created a form "UFrm_Rlink" that has a pull down box "PD_Box"
> > with two choices "P" or "D" and an execution button to run the code.
> >
> > I am having problem with one line of code you supplied so I am sure I have
> > typed it wrong or translated it wrong. I have provided both what I was given
> > and what I have typed.
> >
> > Your code
> > ' Me.lblMsg.Caption = "Refreshing " & tdf.Name
> > ' strNewPath = DLookup("[ConnectString]", "tblBeList", _
> > ' "[TableName] = """ & tdf.Name & "" AND [ProdDev] = """ & _
> > ' Me.txtEnvironment & """")
> >
> >
> > My code
> > Me.lblMsg.Caption = "Refreshing " & tdf.Name
> > strNewPath = DLookup("[ConnectString]", "UTbl_Link", _
> > "[TableName] = """ & tdf.Name & "" AND [ProdDev] = """ & _
> > Me.PD_Box & """")
> >
> > the strNewPath line crahses. Please help
> >
> > Thanks again
> >
> > DDBeards

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Klatuu - =?Utf-8?B?YWNjZXNzZGVzaWduZXI=?= Microsoft Access Forms 24 22nd Nov 2006 01:55 PM
for KLATUU =?Utf-8?B?QWxleGFuZHJhNTA0?= Microsoft Access Form Coding 1 28th Sep 2006 08:43 PM
For Klatuu Gerard Microsoft Access Queries 9 28th Sep 2006 03:22 PM
Klatuu - Need your help again Please =?Utf-8?B?Sm9obk0=?= Microsoft Access Forms 2 18th Feb 2006 05:12 PM
KLATUU--Code to Go thru DB and search table field names for particular name Andre Laplume via AccessMonster.com Microsoft Access VBA Modules 2 22nd Jul 2005 10:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:59 AM.