Access button select form (1 Viewer)

tatiarends

New member
Joined
Apr 14, 2014
Messages
4
Hi,

I have been trying to make this form that I want to create work but seems like I can't really get anywhere, seems like a fairly simple task though

I want to create a form with a field that has a "popup" button (just like the calendar one) This popup would open a matrix where each cell is a button, ex: A1, A2, A3, A4, B1, B2, etc..... The user would then click on whichever cell they want, lets say he clicks cell C3, and then the name of the cell would appear in the field on the form, that is the field would now be populated with the text "C3"

I'm very new with this, so please be specific with what steps to take.

Thank you
 

spikepl

Eledittingent Beliped
Joined
Nov 3, 2010
Messages
6,144
You are asking for something very unusual in Access, and you are using an Excel-term like "cell" which does not exist in Access.

Explain what the ultimate functional point of all this is (rather than just the mechanics of what you are attempting to do) and someone might help you.
 

tatiarends

New member
Joined
Apr 14, 2014
Messages
4
You're not understanding what I meant by "matrix" and "cell" Nothing to do with excel or any table. What I want to make is a popup menu with buttons to select, it just happens that the options are from a matrix. The user is filling out a form, the form has a field that has a button which opens a popup menu (just like the calendar) and that menu has many options to choose from, instead of cells call them coordinates A1, A2, A3, A4, B1, B2, B3, B4 and so on. From there, the user then clicks the option they want, lets say C3, and that option appears (literally I just need the text "C3") in the field.

The reason I need this instead of a combo box is because the user needs to answer that field based on what coordinate applies to him, and it depends entirely in visual locations, just seeing options in a list does not work.
 

tatiarends

New member
Joined
Apr 14, 2014
Messages
4
First I created my main form, lets call it "Mainfrm". I created a text box for where I needed the result of the selection to appear, this textbox must also have as Control Source the table field where you need the results to be stored, let's call it "Coordinate".

I then created another form Matrixfrm (the popup menu) with command buttons each labeled accordingly A1, A2, A3 etc and also make sure the name of the button are those too, this is very important. I created a textbox on that form and labeled it Coordinate and also made the Control Source of that textbox the same as the field in my table, just like I did on Mainfrm. I also made the textbox not visible. Then, for each button of my matrix I put on the On Click event this code:

Private Sub A1_Click()
Me.Coordinate = "A1 - Very High"

On Error GoTo Err_A1_Click

DoCmd.Close


Exit_A1_Click:
Exit Sub

Err_A1_Click:
MsgBox Err.DESCRIPTION
Resume Exit_A1_Click
End Sub

That is for when button A1 is clicked. You must use the same code for each button but changing the labels This code also makes Matrixfrm to exit upon clicking any button, so if you do not want this automatic closing, delete the Exit_A1_Click and below from your code.

This should make your textbox on Mainfrm appear with the result of what you clicked on Matrixfrm.

Hope this helps!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom