Question on Modules & Form Reuse
Been Tinkering with this question. I don't want to create another form because that would be a waste of space (not that it matters) but it wouldn't be the correct way to go about it.
I am working on a function (I think?) and I want to tell a command button which form to show.
So I need to modify what happens when the cmd_click() event is fired. I'm thinking writing, flow charting, and my head is hurting. I've tried coming up with some code but its not working.
I really hope Modules are much easier than this. I haven't successfully been able to run a module (other than pre-canned [long] code)
Should they really let a DJ/Webmaster use VB6?
If I think VB6 is hard what about C++! Trust me been there, gave up after hello world.
Re: Question on Modules & Form Reuse
So all you need to do is show a certian form when a command button is clicked? Or do you want to create the form from scratch when the command button is clicked? Can you give us more info so we can help.
Re: Question on Modules & Form Reuse
User Clicks on an initial push button within that click is the code to tell the push button on another form that pops up what form to load
Is that making sense?
1 Attachment(s)
Re: Question on Modules & Form Reuse
Attached is a form that has a multiple-purpose command button.
As for C++ - been there, done that, can't get the smell out of my head.
Re: Question on Modules & Form Reuse
Quote:
Originally Posted by MartinLiss
As for C++ - been there, done that, can't get the smell out of my head.
I'm hopping that's a bad smell. I remember being much more of a noobie than I am now. (Hard to picture eh). And I remember that if I clicked on a checkbox it had to be validated and pointers and oh my gosh I don't know what the heck I'm talking about but it seems like C++!
Re: Question on Modules & Form Reuse
Marty. That could work but I want lets say in my code. Someone pushes modify contact. The SelectContact form would show.
If I add a task, I need to select a contact for that task. Select Contact. What I need to do is either close / open a form and input a value on the new task screen so when I input it into mysql it works all fine and dandy and everything is referenced correctly.
I want to show my office the beta by the end of the week, b/c we could really use this app. Nothing on the market (for free) like it in fact I haven't seen much of anything like it.
Re: Question on Modules & Form Reuse
Sorry, I don't understand.
Re: Question on Modules & Form Reuse
Let me attach screen shots to help. Give me a little bit.
3 Attachment(s)
Re: Question on Modules & Form Reuse
here you go.
On Main.JPG
User clicks modify contact (Select.jpg) and select client pops up.
On NewTask.JPG
User CLicks the Select Contact (Blue arrow) and Select.JPG pops up.
Re: Question on Modules & Form Reuse
When you say for example "User clicks modify contact (Select.jpg) and select client pops up", are you saying that that already happens and you want to change what happens, or that nothing happens now when you click modify contact and you want select client to pop up?
Re: Question on Modules & Form Reuse
> nothing happens now when you click modify contact and you want select client to pop up?
No No No.. That code works fine.
I want two different types of things to happen from that form, but different actions to be performed depending on where you click the command button to show Select.JPG (Select Contact)
Senario 1:
User Clicks it within New Task...
what's to happen:
Allows you to select a contact, and then return the value of the listview box. (Unload both forms on completion) The Unload part is not a problem.
Senario 2:
User Clicks Modify Contact of the Main Screen.
What's to Happen:
Select Contact Box appears. It will take you into a modify contact screen and have the values populated already.
(Parts in Italics I can cover as soon as solution is solved, on my own time)
Re: Question on Modules & Form Reuse
Maybe you coud use a variable that is an ActionFlag.
VB Code:
ActionFlag = "NewTask"
select case ActionFlag
case "NewTask"
' DO SOMETHING HERE
case "ModifyTask"
' DO SOMETHING ELSE HERE
Re: Question on Modules & Form Reuse
How would I Declare that. Publicly of course.
I do like your code on the Action Flag. I WILL need to incorperate something like that. The title was of modules. So that was something I didn't think of. But Yeah, how would I declare the variable from the command button pressed. I would need a function to declare which action flag is being used correct?
Re: Question on Modules & Form Reuse
If you declare ActionFlag in a module, you can set it and read it from anywhere.
Just set it depending on what form is shown, or which button is pressed. You may need a few other choices, or even another flag. You might be able to set the .tag value of a form to show where the keypress came from
Re: Question on Modules & Form Reuse
That's another thing. I've never sucessfully been able to write to the tag property on runtime, You think it would be easy as formname.Tag but it won't write. This is after the form is set to show. so
form.show
formtag = "something"
and it won't stick. I don't get why. Wierd stuff.
Re: Question on Modules & Form Reuse
Form1.Tag = "new tag value"
Re: Question on Modules & Form Reuse
Almost all controls have a tag property. I use them for many things in one of my programs.
Re: Question on Modules & Form Reuse
I still couldnt get what you want after reading all the posts here. :(