quick question re setting control values

Zaeed

Registered Annoyance
Local time
Tomorrow, 06:22
Joined
Dec 12, 2007
Messages
383
Ok, this may be really stupid and easy but it has me baffled..

I have a form that i use to store the location of my be.. on startup, it checks that forms control, then does its bit and if need be selects and loads the correct be..
for some reason i cannot get the code to reset the control to the new value..

I first had it as a text box, and used the DefaultValue as the source, then had Form!locator.FilePath.DefaultValue = strFilePath

that did nothing

I have now also tried a similar thing using a label and using the caption instead of the defaultvalue..

anyone know what im doing wrong?
(i realise this is probably something really trivial, I've just got back to working on this database after a month of 4th yr engineering exams so my mind is a little fried atm)
 
Ok, I think i know whats happening

It seems that the code correctly assigns the updated location to the form, but when the form closes that information is lost.. I've tried using docmd.save acForm, frmLocator but that gives an error saying i cant use that function at this time.. odd

Any help would be appreciated
 
You can't save design changes like that. Store the info in a table and retreive it.
 
but thats my problem bob, the tables are linked, when the backend is moved, it cant check the table for the value..

I just realised I got this code from this site.. Its the code that relinks the backend tables. In the code, it does a check on the backend location and if needed, prompts a browse window that you use to select the backend. It then relinks the tables and updates the textbox control on the frmLinkManager form
Code:
strFileName = FindBackEnd(strSearchPath)
            Forms!frmLinkManager.FilePath = strFileName

This is the exact code from the example on this site. However, the value put into FilePath is not retained.. When the db is started the control reverts back to its previous value, thus negating the change..

any ideas?
 
ahh... that would help wouldn't it... :rolleyes:

cheers bob
 

Users who are viewing this thread

Back
Top Bottom