> Hi,
> Thanks for the tip. I've taken a look in the registry and the value of
the
> key that has been written is 1, as it should be. However, it still
> sometimes returns 0. Surely if strClient was wrong then it would write
> another value in a new regsitry? There is only one instance of it,
however.
> Any other ideas?
> --
> Regards,
> Jamie Brown, Software Developer
> InfoComp Ltd
> URL: http://www.infocomp.co.uk
> > James,
> > That should be OK, what I would do is break it down though to something
> like
> > ********************* BEGINS ***********************
> > Dim strApp as string
> > dim strVal as string
> > strApp = "STMCFE " & strClient
> > strVal = GetSetting(strApp, "StockApp", "Linked", "0")
> > intLinked = CInt(strval)
> > ' I would do the rest as a Select Case but whatever
> > ********************* ENDS ***********************
> > As you can see effectively little difference.
> > If you continue to have problems have a look at how you are getting
> > strClient.
> > Check in the registry whenever it goes wrong and just see if it's
writing
> > values to places it shouldn't be.
> > --
> > Terry Kreft
> > Access MVP
> > ***********************************************
> > If it's not plain text, without attachments,
> > I'm not reading it.
> > ***********************************************
> > > Hi,
> > > Here is the code:
> > > ********************* BEGINS ***********************
> > > intLinked = CInt(GetSetting("STMCFE " + strClient, "StockApp",
> > "Linked",
> > > "0"))
> > > If intLinked <> 1 Then
> > > if intLinked=0 then
> > > msgbox "First time application has been loaded"
> > > else
> > > msgbox "Relinking, as requested by user"
> > > end if
> > > ... relinking code ...
> > > SaveSetting "STMCFE " + strClient, "StockApp", "Linked", "1"
> > > End If
> > > ********************* ENDS ***********************
> > > strClient never changes (it is build up from the Applications path),
and
> > the
> > > only other time the value in the registry is changed, it is set to 2,
> when
> > > the user wants to relink the database. However, around 1 in 4 times
> that
> > I
> > > run the database it says "First time the application has been loaded."
> > > --
> > > Regards,
> > > Jamie Brown, Software Developer
> > > InfoComp Ltd
> > > URL: http://www.infocomp.co.uk
> > > > Hi,
> > > > I've been using the SaveSetting command in Access VBA to store a
> simple
> > > > string of either "1" or "2" depending on the mode of the
application.
> > If
> > > > the value is "0" it means it has never been assigned, and therefore
> the
> > > > application has never been installed. Nowhere in my application is
> the
> > > > value ever assigned to zero. However, every now and again (say 1 in
4
> > > > times) when I start the database it returns "0" and the database
> starts
> > as
> > > > if it had never been installed.
> > > > Is there some glitch I should know about? I'm using Access2000
> > Developer.
> > > > --
> > > > Regards,
> > > > Jamie Brown, Software Developer
> > > > InfoComp Ltd
> > > > URL: http://www.infocomp.co.uk