permanently change picture on subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, everyone!

I have a subform that I use to demonstrate how a picture will appear as a
form background (centered, tiled, etc.) On the main form, I have controls
that allow the user to browse & select a new picture, set the starting
position, and tile or not tile. The code I have works fine in accomplishing
this.

The problem is that I want to make the user's changes permanent so that the
next time the form is opened their last selection will appear. I tried the
normal "DoCmd.Save". It didn't work. I also tried saving the subform itself
with
DoCmd.Save acForm, [subform name]
but Access kicks an error saying that the form is not open.

How can I get the new subform properties to save?

Thanks,
Bruce
 
BruceS said:
Hi, everyone!

I have a subform that I use to demonstrate how a picture will appear as a
form background (centered, tiled, etc.) On the main form, I have controls
that allow the user to browse & select a new picture, set the starting
position, and tile or not tile. The code I have works fine in
accomplishing
this.

The problem is that I want to make the user's changes permanent so that
the
next time the form is opened their last selection will appear. I tried
the
normal "DoCmd.Save". It didn't work. I also tried saving the subform
itself
with
DoCmd.Save acForm, [subform name]
but Access kicks an error saying that the form is not open.

How can I get the new subform properties to save?

Thanks,
Bruce

What I would do is to save the picture file name in a field in the database,
and refer to it in the subform's Open event. When the user selects a new
picture, just change the file name in the database and it should appear the
next time the subform opens.

Carl Rapson
 
Thanks, Carl. That's what I was doing before, in the Current event. Just
trying to avoid the slight delay as the picture is loaded. Guess I'll just
have to put up with it.

Thanks,
Bruce

Carl Rapson said:
BruceS said:
Hi, everyone!

I have a subform that I use to demonstrate how a picture will appear as a
form background (centered, tiled, etc.) On the main form, I have controls
that allow the user to browse & select a new picture, set the starting
position, and tile or not tile. The code I have works fine in
accomplishing
this.

The problem is that I want to make the user's changes permanent so that
the
next time the form is opened their last selection will appear. I tried
the
normal "DoCmd.Save". It didn't work. I also tried saving the subform
itself
with
DoCmd.Save acForm, [subform name]
but Access kicks an error saying that the form is not open.

How can I get the new subform properties to save?

Thanks,
Bruce

What I would do is to save the picture file name in a field in the database,
and refer to it in the subform's Open event. When the user selects a new
picture, just change the file name in the database and it should appear the
next time the subform opens.

Carl Rapson
 
In
BruceS said:
Hi, everyone!

I have a subform that I use to demonstrate how a picture will appear
as a form background (centered, tiled, etc.) On the main form, I
have controls that allow the user to browse & select a new picture,
set the starting position, and tile or not tile. The code I have
works fine in accomplishing this.

The problem is that I want to make the user's changes permanent so
that the next time the form is opened their last selection will
appear. I tried the normal "DoCmd.Save". It didn't work. I also
tried saving the subform itself with
DoCmd.Save acForm, [subform name]
but Access kicks an error saying that the form is not open.

How can I get the new subform properties to save?

My guess is that your code would have to open the subform in design
view, set its properties all over again, and then save it. Most changes
you make in form view don't stick. It would probably be easier to save
the properties somewhere and reload them in the subform's Open event, as
Carl Rapson suggested.
 
Well, there's only so much we can do within the Access framework. :)

Carl Rapson

BruceS said:
Thanks, Carl. That's what I was doing before, in the Current event. Just
trying to avoid the slight delay as the picture is loaded. Guess I'll
just
have to put up with it.

Thanks,
Bruce

Carl Rapson said:
BruceS said:
Hi, everyone!

I have a subform that I use to demonstrate how a picture will appear as
a
form background (centered, tiled, etc.) On the main form, I have
controls
that allow the user to browse & select a new picture, set the starting
position, and tile or not tile. The code I have works fine in
accomplishing
this.

The problem is that I want to make the user's changes permanent so that
the
next time the form is opened their last selection will appear. I tried
the
normal "DoCmd.Save". It didn't work. I also tried saving the subform
itself
with
DoCmd.Save acForm, [subform name]
but Access kicks an error saying that the form is not open.

How can I get the new subform properties to save?

Thanks,
Bruce

What I would do is to save the picture file name in a field in the
database,
and refer to it in the subform's Open event. When the user selects a new
picture, just change the file name in the database and it should appear
the
next time the subform opens.

Carl Rapson
 
Back
Top