using setvalue macro

lubbs65

Board Regular
Joined
Jun 1, 2011
Messages
80
Okay, so I am 99.9999% sure i had this macro working but now it just refuses.

I may go into greater detail, but a macro I previously thought was working is no longer and i believe I know the source.

setvalue simply isn't working.
In the propertly value for a sheet I have the following (prior really shouldn't be too important)

1)MsgBox with the message just saying "next step"
2)SetValue with item [This is a textbox] and expression CurrentUser()

Originally I had a better expression that would have some meaning. For whatever reason though, the textbox [This is a textbox] will not set to a value. I put the message box there to make sure that the step SetValue is getting triggered, so I know it is, but the value will not set. I am using a 2003 .mdb file if that matters at all. any ideas for just having this textbox get a set default value?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Open your form in design view and select the text box and then open the properties, in the properties you can set a default value.

I would also check to see what the source of the text field is and follow it back to the table and also check the properties out in the table as you can also set a default value there.
 
Upvote 0
I cant use your method. the field doesn't truly have a default value.
What happens is I have a base form. In the "Name" combo box you type in the last name "oqweuq" which does not exist. This therefore opens up the "Name Form" form (the form i am trying to use setvalue in). I am now trying to have it so that upon opening the name form this way by using the events ->on load property I can then use setvalue to insert a the last name typed into the name combo box and putting it into the last name field in the "name form". This macro should not be triggered when someone decides to just open the form "name form" just because so i already have proper stopMacro macro's before the setvalue macro.

I'm pretty sure my macro was previously working. I'm trying to figure out if i changed a setting.

But now im checking the SetValue setting to see if I can even set a value which doesn't seem to even be working. Once I get setValue working, I have to ensure that the variable is properly saving from the base form when going into "name form"

What I just discovered
I just confirmed my initial suspicions:
My macro works in a 2007 database, but not a 2003 .mdb file. Ideas?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,753
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top