Solved

Created option array(s) not visible

Posted on 2004-04-21
7
157 Views
Last Modified: 2010-08-05
I have created a form with 3 option buttons in 1 frame - frame1(0)  opt_ads(0) opt_percent(0)

though a loop I use the load statement to add 5 more combinations of the above ( in other words - an array of frame1(0) - frame1(5) and arrays of opt_ads(0) - opt_ads(5) and opt_percent(0) - opt_percent(5)
Each option button when created is assigned a container - to the corresponding frame - they do fit inside the frame

with frm_TimedDisplays
 for i = 1 to 5        
    Load .Frame1(i)
            With .Frame1(i)
                .Top = yPos - 10
                .Visible = True
                .ZOrder 0
            End With

   Load .opt_Ads(i)
            With .opt_Ads(i)
                .Top = yPos
                Set frm_TimedDisplays.opt_Ads(i).Container = frm_TimedDisplays.Frame1(i)
                .Visible = True
            End With

   Load .opt_Percentage(i)
            With .opt_Percentage(i)
                .Top = yPos
                Set frm_TimedDisplays.opt_Percentage(i).Container = frm_TimedDisplays.Frame1(i)
                .Visible = True
            End With
       
 next i
end with

 I have varified that the container statement does in fact work ( I can see the property - set focus to the button- and othe verifications)  properly and the option buttons are in fact put in as part of that frame -

THE PROBLEM (finally:)

I can't get the option buttons to appear - I have tried Zorder on the buttons , frames, containers - Set AutoRedraw - made frames invisible - then visible - same with buttons - Its like when you design a frame and put buttons on it sometimes you have to "sendtoback" the frame - this works fine in design but I cannot get anything to work programmically

please advise - thanks
bc

0
Comment
Question by:bczingo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 3

Author Comment

by:bczingo
ID: 10883379
oops - should read 2 option buttons
0
 
LVL 19

Expert Comment

by:Shauli
ID: 10884031
Dim yPos As Long

yPos = Frame1(0).Top + Frame1(0).Height

With frm_TimedDisplays
    For i = 1 To 5
        Load .Frame1(i)
            With .Frame1(i)
                .Top = yPos
                .Visible = True
            End With

        Load .opt_ads(i)
            With .opt_ads(i)
                Set frm_TimedDisplays.opt_ads(i).Container = frm_TimedDisplays.Frame1(i)
                .Top = opt_ads(0).Top
                .Visible = True
            End With

        Load .opt_percent(i)
            With .opt_percent(i)
                Set frm_TimedDisplays.opt_percent(i).Container = frm_TimedDisplays.Frame1(i)
                .Top = opt_percent(0).Top
                .Visible = True
            End With
    yPos = Frame1(i).Top + Frame1(i).Height
    Next i
End With

S
0
 
LVL 3

Author Comment

by:bczingo
ID: 10889152
thanks S - but it doesn't help - I've made sure that the opt buttons are inside the frame several different ways-
Its like I said - make a frame - put opt buttons in it - send opt buttons to back and you can't see them but they are there
I need to bring them to the front

besides - It seem your code starts the top of the opt button at the bottom of the frame anyway
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 19

Expert Comment

by:Shauli
ID: 10889245
Have you ran this code? I don't think so. Start a project put the Frame1(0) on it and the two Option buttons(0) on it. Put a command button and put my code in the command button click event. It works. Itested it.

Good luck,

S
0
 
LVL 19

Accepted Solution

by:
Shauli earned 500 total points
ID: 10889663
ps. The reason why your code doesn't work is NOT because the option buttons are sent to back, it is because their TOP property is not set right. Same thing with the frame. That is all. The top property of the option buttons should be the same as the first buttons (in frame(0)). as they are located in a duplicated frame, and the top begins from 0 in each new frame. Then with your frame - you locate the new frames ON TOP of the original frame and subtract 10?????? if you want the frames one below the other then you need to calculate the top of the first frame and its height as I did in my code : yPos = Frame1(0).Top + Frame1(0).Height

Now, with that in mind, copy my code to your project and test it. It will work.

Hope this clears this issue,

S
0
 
LVL 3

Author Comment

by:bczingo
ID: 10893811
sorry left out-
before the loop
yInc= frame1(0).height + (frame1(0).height*.25)

and at end inside of loop

yPos = yPos + yInc

The frames do space down the form


I ended up kludging solution with checkboxes
havent tried your code yet - but i will
thanks
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month5 days, 21 hours left to enroll

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question