473,225 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

Command Button not displaying on form after a reload

I have a form with a form in my application.

When the form is reloaded, a particular command button refuses to display even when there was no command to hide it. It only shows a blank shape where the button is supposed to be.

Has anybody experienced this in the past.

Kindly help me out with this as it does the same on clients' machines after compillation and deployment.
Attached Images
File Type: jpg form with button.jpg (26.7 KB, 391 views)
File Type: jpg form without button.jpg (28.0 KB, 361 views)
Dec 26 '11 #1
11 3552
8,435 Expert 8TB
I think we need you to provide us with some more background info. For instance...
  • What version of VB are you using?
  • What exactly do you mean by "reloading" the form?
  • What does a "form with a form" mean?
Dec 27 '11 #2
Thank you Killer42
Im using VB6
by reloading, i mean unloading the form and then loading the form again to clear the data entered bythe user,thereby making the form blank and ready for data entry again

unload me

"form with a form": this is a typo error. please pardon me for that, i meant "form with a command button".
Dec 27 '11 #3
8,435 Expert 8TB

Not sure exactly what the problem is, but I must say it sounds like a bad idea to unload a form and then show it again, from within the form. At a guess, this could be causing VB some confusion. The unload command is supposed to entirely remove the form (including all code) from memory. Not sure how things work if you're still "in" the form executing code afterward. You're effectively telling VB "erase this code which I'm executing". Ugh.

As a general rule, I'd advise against using the statement Unload Me unless it's the last one executed by "Me".

Best I can think of right now is to either:
  • do this process from outside the form, or
  • create a sub that clears all the data, and call that instead of reloading the form.
Oh, one more thing you might try first, since it's quicker and easier. Try fiddling with the form's ClipControls and AutoRedraw properties (just in the editor I mean, not your code), to see whether they make a difference. But make sure you make a note of what they are beforehand, so you can put them back afterward.
Dec 27 '11 #4
Hi Killer42
I had tried clipcontrols and AutoRedraw earlier. I think the issue is related to the fact that the button's style was set to graphics. I needed to set a back color for the button to let user identify it easily (these are old people with very little knowledge of the computer).

Now, I changed style to default and it works fine.
I still need to find a way to change the back color of that button without losing it on the form.

For the unload and reload thing.

Because the amount of items to be cleared are so much and there are so many other routines to be called after each data submission, it became difficult to just clear the form without unloading (the process is an online real time process which involves so many symultaneous complex database activities). And since the time difference is just in nanoseconds on a 486, I thought it will make no difference on a pentium or higher.
However, the form.show is called from an external procedure not within the form.

Thanks once again.
Dec 27 '11 #5
This might sound kind of silly, but perhaps adding
Expand|Select|Wrap|Line Numbers
  1. in Form_Load:
  2. DoEvents
  3. Me.Show
This _might_ solve this visual glitch.
Dec 27 '11 #6
Thanks BigPapa,
The above code did not even solve the problem.

I think there is an issue with the graphics style of the command button. It works well if set to standard. Issue arises when style is set to graphics.
Dec 27 '11 #7
While this isn't a fix, but rather a workaround, you might try keeping it a standard style and setting it to graphical via code after the form is loaded. Unfortunately, I have been unable to recreate the issue on my system and have never heard of this issue.

Please keep us updated on this, we're always here to help!

PS - Have you also updated VB6 with the latest service pack?
Dec 27 '11 #8
8,435 Expert 8TB
Yes, I'm afraid I'm pretty much out of ideas. It's really tough to investigate something like this without being able to reproduce it.

All I can think of is experimentation with things like the button's .Refresh method, switching between standard & graphic modes, switching visibility on and off, and anything else you can come up with. Including switching style after the form's loaded, as BigPapaN0z suggested.
Dec 28 '11 #9
8,435 Expert 8TB
P.S. One more thing I was wondering about. Is there anything else which is in front of the button, but not currently visible?

In any case, another "just in case" option you might try is using Format | Order | Bring to Front to bring this button to the front of the Z-order, just in case something is obscuring it.
Dec 28 '11 #10
Thank you guys for your help tips.
The style property is actually read only at run time so that is not an option.

The button has nothing in front of it but it is inside a frame as other controls. The other controls do not have any issues and I see no reason so far why this is happening,perhaps because it is the most active button and one that closes the form, because all other buttons are set as graphical also.
For now, I have decided to leave it as default so I can just meet my dead line. I shall keep working around until I find a solution. Once I do, you'll know about it.

Thank you all once agai. This family is a good one.
Dec 28 '11 #11
8,435 Expert 8TB
Sorry we couldn't help you solve that one.

And yes, please let us know if you do find a solution, so it'll be here if anyone else needs it.

P.S. If it's in a frame, the .ClipControls property of the frame applies to it, not the form. No idea whether this will help.
Dec 28 '11 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Colin | last post by:
I have a main form with a command button on it that when clicked, opens a subform displaying records that relate to the main form. I would like to disable the command button if the corresponding...
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
by: emc_cos | last post by:
I have a very nice parent child relationship happening between a main form and 8 subforms. The main form is the data entry point for a table that holds textual data like names, notes and the...
by: afr0ninja | last post by:
Hello! I'm currently working on a form that has several input fields and a subform. What I'm trying to accomplish is that when I first open the form I'd like to have the input fields displayed...
by: moogen | last post by:
Hi Everyone, I need to have a command button placed in a form (that is displaying a customers data) that when pressed will open a new form where I can enter in various information concerning that...
by: emandel | last post by:
I am an armature access programmer trying my best to design my own database so your patience and detailed instructions is much appreciated. Here is my question: How do I get a command button (on...
by: WiscCard | last post by:
This seems simple enough, but I am having problems. I have a table of customer information. I have a form with various combo boxes displaying unique customer information (in this case, zone and...
by: buddyr | last post by:
Hello, I have a cmd button on form to search for serial number. I notice when I search for record-that if I don't start at the beginning of records I might not find the record. example: if I am...
by: Bre035 | last post by:
Created a database that I want to be maintained and updated by the Department designated Admins. I have an user table that set specific individuals access to Admin and created admin form and...
by: Paul Wilson | last post by:
Access 2003 Sp2 Pretty new to Access so please bear with me! I have created a simple database which has 4 tables with matching column names but info from different systems. I have merged some...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.