I have a form that the operator can use to select the file that the database should be linked to using the Common Dialog Form. The problem is that I am then taking that file name and turning it into the job number using the Right and Left function to get only the file name out of the path and file extension.
txtFiletoOpen is the control on the form that contains the path and file to open from the common dialog form, i.e. C:\Program Files\Jobs\G457.mdb
The code is as follows -
Dim strBackEnd as string
strBackEnd = Me.txtFiletoOpen.Value
strBackEnd = Right((Me.txtFiletoOpen.value), _
len(Me.txtFiletoOpen.value) _
- len(GetDBDir(Me.txtFiletoOpen.value)))
strBackEnd = Left(strBackEnd, len(strBackEnd) - 4)
It appears that the code is working up to the last line of code as I get strBackEnd = G457.mdb , when what I should get is strBackEnd = G457
Thanks for your help in advance.
BusMgr
txtFiletoOpen is the control on the form that contains the path and file to open from the common dialog form, i.e. C:\Program Files\Jobs\G457.mdb
The code is as follows -
Dim strBackEnd as string
strBackEnd = Me.txtFiletoOpen.Value
strBackEnd = Right((Me.txtFiletoOpen.value), _
len(Me.txtFiletoOpen.value) _
- len(GetDBDir(Me.txtFiletoOpen.value)))
strBackEnd = Left(strBackEnd, len(strBackEnd) - 4)
It appears that the code is working up to the last line of code as I get strBackEnd = G457.mdb , when what I should get is strBackEnd = G457
Thanks for your help in advance.
BusMgr