Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command button to insert object to bounded frame object box 1

Status
Not open for further replies.

mtabt

Technical User
Apr 25, 2001
23
US
My table contains a field that is a bounded frame object. It is shown on my form, I would like to add command button so users can insert any object into the bounded frame object at will.

Currently, users have to right-click on the bounded frame object box and insert the object that way. I would like to use a command button instead.

Any help will be appreciated.

Thank you very much.
 
In your command buttons click event set the focus to your object frame and then the insert object command. Like so:

YourObjectNameHere.SetFocus
DoCmd.RunCommand acCmdInsertObject

Hope this helps. ljprodev@yahoo.com
Professional Development
MS Access Applications
 
Thank you for your help, LonnieJohnson. Everything works fine.

However, is there a way to restrict the users to insert an object from a file rather than new..??

By default, a dialog comes up asking if you want to insert an object by "create new" or "create from file". I only want to allow users to "create from file". This will cause less confusions.

Thank you very much, any help will be appreciated.
 
Having problems with my inserting of an object. I too right click, and all the options come up (after this thread, will attach thig through a button thought - thanks), but when i go back to the record that i jsut inserted my Map in. it is not there. Although it says in the tabel (datasheet view) that there is a Microsoft Picture Editor image in there.

Where am i going wrong? Thank you for your help already.

Matt Pearcey
 
mtabt,

Here is a little something I did with an Image contol, a command button and an InputBox...

Private Sub CommandButton_Click()

Dim strPath As String
strPath = InputBox("Where is your picture?")
ImageBoxName.Picture = strPath
End Sub

This will allow the user to type in the path of the image you wish to view. If you know all your pictures are in one folder you can modify strPath's value like so...

strPath = "C:\MyFolder\" & InputBox("Which Picture?")

Maybe this will help you out a little or someone else can expound on it.

B-)
ljprodev@yahoo.com
ProDev
MS Access Applications
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top