Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Linked Databases
I am working on a ticket program for the theatre at my high school.
Right now I have created a seating map using labels and withevents to control them. I have a 1 to 1 relationship between the cells and the labels I was wondering if there was way to have the labels in the same configuration but be able to input data in the spreadsheet so A1 would be the customers name, B1 would be how many adult seats they have, C1 would be how many student seats they have, and D1 would be whether the seats have been paid for or are under will call. If I can't do that I would like to create some linked databases where each database would hold some piece of information like the costumers name. Any help would be appreciated. Thanks. Public Sub UserForm_Initialize() UserForm1.Caption = "Ticket Pro 4.3" Dim cls As Class1 Dim ctr As MSForms.Label Dim r As Long, c As Long, rr As Long, cc As Long Dim vSeats Const cLabW As Single = 16 Const cLabH As Single = 16 Const cGap As Single = 1.85 Dim i As Long, cnt As Long Dim sRef As String Dim sAddr As String 'Sheet1.Activate Dim cel As Range, ra As Range, seat As Range Dim maxCols As Long, nRows As Long Dim lt As Single, tp As Single Const cHaisle = 14, cVaisle = 13 'Dim selectedseats() sAddr = "a1:I1, a2:L13, b15:l15, c16:l16, d17:l17, e18:l18, f19:l19, g20:l21, h22:l22, i23:l23, n4:z13, n15:z16, o17:z18, o19:y20, o21:x22, o23:w23, ae1:am1, ab2:am13, ab15:al15, ab16:ak16, ab17:aj17, ab18:ai18, ab19:ah19, ab20:ag21, ab22:af22, ab23:ae23" Set grngSeats = ThisWorkbook.ActiveSheet.Range(sAddr) 'grngSeats.Value = 2 cnt = grngSeats.Count ReDim clsLabels(1 To cnt) nRows = 0 For Each ra In grngSeats.Areas If ra.Columns.Count maxCols Then maxCols = ra.Columns.Count End If nRows = nRows + ra.Rows.Count Next ReDim clsLabels(1 To grngSeats.Count) Me.BackColor = vbWhite Me.Height = 550 'nRows * (cLabH + cGap) + (2 * cGap) + 21 + cLabH / 2 Me.Width = 700 'maxCols * (cLabW + cGap) + (2 * cGap) + cLabW / 2 For Each ra In grngSeats.Areas For Each cel In ra r = cel.Row: c = cel.Column i = i + 1 Set clsLabels(i) = New Class1 Set ctr = Me.Controls.Add("Forms.Label.1") With ctr lt = (c - 1) * (cLabW + cGap) .Left = lt tp = (r - 1) * (cLabH + cGap) .Top = tp .Height = cLabH .Width = cLabW .BorderStyle = fmBorderStyleSingle .TextAlign = fmTextAlignCenter If cel < Empty Then .BackColor = vbRed Else .BackColor = RGB(210, 210, 210) End If '.Caption = i End With Set clsLabels(i).lab = ctr Set clsLabels(i).rSeat = cel clsLabels(i).id = i clsLabels(i).sRef = sRef Next Next End Sub - David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
databases | Excel Worksheet Functions | |||
Comparing databases | Excel Discussion (Misc queries) | |||
Databases | Excel Discussion (Misc queries) | |||
LINK DATABASEs | New Users to Excel | |||
DATABASES | Excel Discussion (Misc queries) |