Wrox Programmer Forums
|
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 April 1st, 2005, 11:02 PM
Authorized User
 
Join Date: Mar 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default inserting data into a table

I've an image on my access form on clicking which some data should directly enter into the table. I dont have any labels or textboxes on my form.I tried placing text boxes and making them invisible. But there should be some way by which i can enter the data directly into the table like writing a query to insert or something..
Just on clicking particular part of the image,the data should enter in the table. Can you please help me do that.
Thanks...

 
Old April 4th, 2005, 10:19 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

You can’t enter data directly; after all, what is the value of a click, and how could you store that? You are going to need some code, at least.

Access command buttons have a property you can set, called “transparent.” A transparent button doesn’t show, but it has click, double-click (etc.) events, and can be enabled or disabled like an opaque button.

You can place transparent buttons over the top of your image (using several of different sizes side-by-side to create non-rectangular clickable areas) and use the click events of those buttons to update your data.
 
Old April 4th, 2005, 12:29 PM
Authorized User
 
Join Date: Mar 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a million!!!
I never got the idea of placing transparent buttons!Instead I was trying to cut my image into 150 pieces and writing code for each piece!
I have another question related to this.Can I have colored command buttons? I tried to right click on the button and use the Fill Back color but that is disabled for command buttons.only the Fill Fore color is enabled. I want to use colored command buttons only because on clicking a particular part of my image the color of that part should change and data should be entered into the table. Please help and Thanks again.

 
Old April 4th, 2005, 12:41 PM
Authorized User
 
Join Date: Mar 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I used the picture property for the command button and inserted a plain colored picute and that works.
Can I change the appearance of a command button? I want it to be flat and not raisen. It shouldnt appear like a command button to the user. The special effect thing is disabled too..
Please help!!!

 
Old April 5th, 2005, 11:29 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Usually you emulate a command button when doing the sort of thing you’re talking about. You create an image for what you want the button to look like normally, and another for what you want it to look like while the mouse button is pressed, and change to that picture in the OnMouseDown event, restoring the “non-depressed” picture OnMouseUp.

It gets really invloved to truly emulate a button, because a true button is pretty spophisticated. If you press and hold the left mouse button on a command button, the image shows the cmd depressed.
If you continue to hold the mouse button and roll off of the cmd, the image reverts to non-depressed. If you then roll back over it, the button will go back to appearing depressed. Whether the Click event fires or not is determined by whether you are- or are not over the cmd at the time you release the mouse button.

All that is pretty hard to emulate!
 
Old April 6th, 2005, 09:23 PM
Authorized User
 
Join Date: Mar 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I agree that its a complicated thing to emulate a command button. But even in the Help,it says that one can change the color and border of the controls(including command button)but those button Fill/Color and Special effect and Line/Border are disabled as soon as I select the command button.
My task is almost done,linking to data base, storing values into the table,designing the form...
Only this thing is left out. Is there no way I can enable those Fill back color and special effect buttons on the toolbar? In VB if the style property is set to graphical,all the manipulations on the controls can be accomplised but I am not finding any solution in MS Access... Please see if there is some way!Please!

 
Old April 7th, 2005, 11:32 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Can you explain in detail what it is that you want to do, what the various anticipated user interactions are and what you want the results of those to be (roll-over, click, selecting through tabbing, etc), what the context of this control will be (it sounds like you are putting it on a toolbar, is that right?), and whatever else you can think of that will enhance my visualizing what the situation is?
 
Old April 7th, 2005, 11:26 PM
Authorized User
 
Join Date: Mar 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've troubled you a lot really!Thank you soo much. I've accomplised the task which I was trying to do. I know I dint express it properly.
But thanks a lot. I started with transparent command buttons and a rectangular box... and finally could do what I really wanted!
Thanks a lot!! I'm really greatful to you.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting new field to a table elygp SQL Language 3 March 19th, 2008 12:03 PM
Inserting data into table from DTS Package Crowandazi SQL Server DTS 1 July 29th, 2005 12:30 AM
Inserting a value from one table to another Hudson40 Access VBA 1 February 25th, 2005 08:54 AM
copying from table 1 inserting in table 2 gilgalbiblewheel Java GUI 0 September 15th, 2004 03:40 PM
Inserting table in RichTextbox agarwalmk VS.NET 2002/2003 0 February 11th, 2004 05:16 PM





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