Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 23rd, 2007, 03:59 PM
Authorized User
 
Join Date: Apr 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default Create rectangle on a form with Vba

Is there a vba method to create a rectangle on a form. As a user of the form clicks on items in a list I want to create a rectangle object each time. I thought I was on the right path using the CreateControl method for example:

Set shpBox = CreateControl(Forms!Pop_LoadBundles, acRectangle, acDetail, "", "", Lft, Tp, Lg, Ht)

HOWEVER, I am mistaken as such a method would be used on a rectangle control, yet I just want to create a standard shape of a rectangle and place it on my form.

Any help is always greatly appreciated.

Thanks, Coby.



 
Old May 24th, 2007, 06:32 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Probably the easiest thing to do (since I am short on time today) is to create the rectangle yourself, and then set its Visible property to No. Then add an event that will fire when the user clicks on items, and have that event set the visible property to Yes (True in VBA).

You can create a series of them, and then set them to visible one at a time if you want the users to select a bunch of them. Just use a seperate field to keep a count of the current number of checks. Or use a public variable.

Did that help?

mmcdonal
 
Old June 25th, 2007, 04:11 PM
Authorized User
 
Join Date: Apr 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is working. Thanks again, mmcdonal.

Coby.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Create VBA Feedback Form neodjandre Excel VBA 0 October 16th, 2007 04:34 PM
Create a .DLL callable from VBA Dan412 VB How-To 1 August 20th, 2007 10:32 AM
VBA to create PDF from webpage ncarty97 Excel VBA 0 September 25th, 2006 02:48 PM
Create/Add controls to Access Form: VBA program AccessBeginner Access VBA 1 October 13th, 2005 06:48 AM
VBA to create relationships in Access sunny76 Access VBA 2 July 4th, 2005 01:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.