From: kenrav on
I recently upsized my BE to SQL Server 2008 Express. As expected, my new
tables all have a "dbo_" prefix. I can easily do a 'Search & Replace' in my
code to accommodate the new names. However, I have a great many combo boxes
which reference the original table names in the Data Row Source property that
need to be changed. Does anyone know how to do this universally or do I need
to change each one individually? Thanks.
From: Douglas J. Steele on
Why not just rename your linked tables?

Dim db As DAO.Database
Dim tdf As DAO.TableDef

Set db = CurrentDb()
For Each tdf In db.TableDefs
If Left$(tdf.Name, 4) = "dbo_" Then
tdf.Name = Mid$(tdf.Name, 5)
End If
Next tdf

Set tdf = Nothing
Set db = Nothing

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


"kenrav" <kenrav(a)discussions.microsoft.com> wrote in message
news:C622DF98-A97C-4B18-810F-0F2398DEAFBF(a)microsoft.com...
>I recently upsized my BE to SQL Server 2008 Express. As expected, my new
> tables all have a "dbo_" prefix. I can easily do a 'Search & Replace' in
> my
> code to accommodate the new names. However, I have a great many combo
> boxes
> which reference the original table names in the Data Row Source property
> that
> need to be changed. Does anyone know how to do this universally or do I
> need
> to change each one individually? Thanks.


From: kenrav on
Works great! Thanks!

Ken

"Douglas J. Steele" wrote:

> Why not just rename your linked tables?
>
> Dim db As DAO.Database
> Dim tdf As DAO.TableDef
>
> Set db = CurrentDb()
> For Each tdf In db.TableDefs
> If Left$(tdf.Name, 4) = "dbo_" Then
> tdf.Name = Mid$(tdf.Name, 5)
> End If
> Next tdf
>
> Set tdf = Nothing
> Set db = Nothing
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "kenrav" <kenrav(a)discussions.microsoft.com> wrote in message
> news:C622DF98-A97C-4B18-810F-0F2398DEAFBF(a)microsoft.com...
> >I recently upsized my BE to SQL Server 2008 Express. As expected, my new
> > tables all have a "dbo_" prefix. I can easily do a 'Search & Replace' in
> > my
> > code to accommodate the new names. However, I have a great many combo
> > boxes
> > which reference the original table names in the Data Row Source property
> > that
> > need to be changed. Does anyone know how to do this universally or do I
> > need
> > to change each one individually? Thanks.
>
>
> .
>