Buttons to display information

Whiskeyz

New member
Local time
Today, 14:09
Joined
Sep 3, 2014
Messages
2
Dear AccessWorld friends,

I would like to first state that I am new to Access and trying my best to pick up on skills, so pardon if my questions seemed redundant or illogical.
I'm trying to create a sort of quick-access/all-in-one Access form that..
1) Displays contact details stored in an excel sheet
2) Opens application on click
3) etc..

I am able to get pointer 2 sorted out, however am having trouble with pointer 1.

I have the contact details stored in an excel sheet, of which I am aware of how to import it into Access.
However, my idea was to have a tab where firstly there are 4 buttons, say buttonA to buttonD.
I want it to perform an action such that when i click buttonA, 5 other buttons (say button1 to button5) appear on the right of the 4 existing buttons.
If I press buttonB however, button6 to button10 will appear and replace the button1 to button5 at the same spot.
After which, if I press button1 etc, there will be a field where contact details are displayed (name/number/etc) and it switches as I press different buttons.

I tried searching but lack the technical knowledge to know what the keywords are in finding help for this issue, hence may some kind soul help me out by guiding me to the right path?

Thank you so much

Cheers,
Whiskeyz
 
When you say your data is stored in an excel sheet which you import into access. Does this mean you import the spreadsheet in each time you want to use it or whenever it is updated. In which case you would be better linkeing to it rather than importing it, that way you would always be working with the latest data.
 
When you say your data is stored in an excel sheet which you import into access. Does this mean you import the spreadsheet in each time you want to use it or whenever it is updated. In which case you would be better linkeing to it rather than importing it, that way you would always be working with the latest data.

Yup it is linked, I have no problem with the data management, more on the aforementioned problems with buttons and their functions.
 
You could use a Case Select statement to assign properties to buttons 1 to 5 depending on whether button A,B,C or D are clicked. Such as:

Code:
Select Case ButtonClicked
   Case ButtonA
      Button1.Caption = "Do This"
      Button2.Caption = "Do That"
      Button3.Caption = "Do Something"
      etc. etc. etc.
   Case Button B
      Button1.Caption = "Print This"
      Button2.Caption = "Print That"
      Button3.Caption = "Print Something"
      etc. etc. etc.
.........
End Select

Then for buttons 1 to 5 on the OnClick() sub routine perform actions depending on the button caption. Such as:

Code:
Private Sub Button1_Click()
   Select Case Button1.Caption
      Case "Do This"
         ' Code what you want it to do here
      Case "Print This"
         ' Code what you want it to do here
      etc. etc.
..........
End Select

Hope this helps

Dave
 

Users who are viewing this thread

Back
Top Bottom