Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Use command button to show/hide objects?

Use command button to show/hide objects?

Use command button to show/hide objects?


I'm new to approach and I can't seem to find much assistance in constructing a new database from scratch. I know the basics of using databases from experience with access but there are a couple of things I can't seem to be able to do too easily in approach. Firstly accessing the code manager is ok but are there any guides on using it as it doesn't seeem as intuitive as access. Also how do I show / hide objects on a form on the click of a button. Last question, if I want to show selected fields on a form, as a dialogue box if necessary, is there the option to make it sizeable and set the screen position on opening.

I hope someone can assist me with this 'cos the Lotus help files only seem to apply to the basics.


RE: Use command button to show/hide objects?

You'll find plenty more resources at http://www.xpertss.com including FAQs and free downloads of LotusScript samples.

Let's say you have a button and want to toggle its caption between Show/Hide when clicked and toggle the visibility of controls at the same.

Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)

 Dim intVisible As Integer 'No boolean data type in LotusScript, use Integer

 'Check the button caption, set the visiblity state
 intVisible = (Source.Text = "Show")

 With Source.Parent
  'This assumes the controls are within the same
  'panel as the button. Source.Parent returns the panel
  .fbxField1.Visible = intVisible
  .fbxField2.Visible = intVisible
  'and so on where fbxField1 is the object name of a
  'fieldbox for example
 End With

 'Set the button caption
 If intVisible Then
  Source.Text = "Hide"
  Source.Text = "Show"
 End If

End Sub

The LotusScript IDE is quite good when you get used to it. Is there anything particular you want to do that you can't find? There's a Lotus PDF in the Free Downloads at XpertSS, Developing SmartSuite Applications using LotusScript that has a chapter on the IDE.

If using Approach 9.5 or later use the Dialog Editor to create a dialog. A Lotus Dialog with LotusControls (these aren't the regular Approach controls) is very similar to a VB form.

See apr-dlgs.zip in the XpertSS Free Downloads for a working example.

Also at XpertSS, in the Approach | FAQS | Tips and Techniques folder, under the discussion Win32 API functions, see "How to centre a Lotus Dialog in the screen"

There's another way in Approach - create a regular form to use as a dialog and set it to Show As Dialog on the Macros tab of the form properties sheet. These are rather buggy both at design time (when adding unbound fields) and run time (crashing Approach). Again, see the item in the Tips folder, "Dialog form rules"

Lotus Dialogs were introduced in 9.5 and I recommend using them rather than "forms as dialog" You'll find the objects and coding more like VB and VBA too.

Paul Bent
Northwind IT Systems

RE: Use command button to show/hide objects?

Thanks Paul,

Those tips should help no end. I'll spend a bit of time looking into it.

Great speedy response.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close