Solved

Grid design for controls in form

Posted on 2000-02-13
4
238 Views
Last Modified: 2012-06-21
I am trying to design a form where I have controls in a grid design 30 X 30 on a form, with all the controls unbound.  The idea is that users will be able to click on controls on the form and change the foreground and background colours with the aim of easily allowing users to graphically show where items are stored in a storage area.  I have created a details form with colour coding for each item selected by the user and can tranfer this information using code. However, I cannot workout how to store the info for each control and make the grid work short of making a separate table for each control in the grid and using subforms. Any ideas?
0
Comment
Question by:muscats
[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
4 Comments
 
LVL 6

Expert Comment

by:simonbennett
ID: 2518396
Im not convinced I get this. Are you wanting to graphically represent data using text boxes, and store this?

From what you are saying you will have a 'grid' of 30 by 30 textboxes. When clicked upon, you want the colour(s) to change. You also want the user to be able to close the form, exit the app, and when the return to have the form in the same state?

Thanks

Simon
0
 
LVL 6

Expert Comment

by:simonbennett
ID: 2518426
Whoops...

If so, then try this. Create a table like this called tblState

ID(int) ForeColour (long) Backcolour (long)
0       0                 256
1       8                 256
2       128               1024

Make your controls into a control array (called txtDisplay for eg) for ease of use. When opening the form, you can refer to each element in the array with the ID field in the new table. e.g.

with tblState
   Do while not .Eof
      Me.txtDisplay(![ID]).forecolor = ![Forecolor]
      Me.txtDisplay(![ID]).backcolor = ![backcolor]
      .movenext
   loop
end with

To save, when exiting the form just reverse the process like

For intLoopCount = 0 to 29

   set rstSave = currentdb.openrecordset("Select * From tblState Where ID = " & trim(str(intloopcount)),dbopendynaset)

   if rstsave.recordcount > 0 then

      rstsave.edit
      rstsave![ForeColor]=me.txtdisplay(intloopcount).forecolor
      rstsave![BackColor]=me.txtdisplay(intloopcount).backcolor
      rstsave.update

   end if

   rstsave.close

next intloopcount

HTH

Simon
0
 

Expert Comment

by:MIDA
ID: 2520436
If you have a stable design, you could try a solution like this:
create a user type to represent each of your button, and either make a table containing all your buttons data ( but take care of the limit on the nuimber of fields in a table) or better, make a master detail design with a table for the total store, and a table linked by a foreign key to the previous one, rerpesenting one button per record or a row of buttons (30) per record. Then you can choose to represent it as a single form with a query joining all the info, or as a master detail form...
0
 
LVL 6

Accepted Solution

by:
simonbennett earned 200 total points
ID: 2553868
Locking to get some attention!

Please reject and review comments.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

734 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