kenan 28.06.2017-19:53
Subject: Raspored kucica

Pozdrav svima

Pravim kasu za ugostiteljstvo gdje di trebao biti prikazan raspored stolova u sali a može i da stolovi budu liniski prikazani. Eh, sad bih ja htio da na formi dodam stolove kao dugmiče (i to mi radi) ali ja hoču kada dođe do red dugmadi do kraja ekrana (ili po vertikali ili horizontali nije bitno ) pređe u drugi red odnosno kad i drugi red dođe do kraja ekrana ide u treču i tako dok ima dugmadi za kreiranje.

Gjoreski 28.06.2017-20:13
Subject: Re: Raspored kucica

Ja sam to resio malo drugaije kod mene.
Ti ovo zelis jer imas vise stolova od mesta na ekranu. Barem ja tako predpostavljam.
Ja sam stio iznad stolova jos 5 dugmeca sa koi biram koi stolovi cu prikazati .
Za svako jedno dugme imam po 50 stolova i mislim da je to sasvim dovolno .

Gjoreski 28.06.2017-20:13
Subject: Re: Raspored kucica

Ja sam to resio malo drugaije kod mene.
Ti ovo zelis jer imas vise stolova od mesta na ekranu. Barem ja tako predpostavljam.
Ja sam stio iznad stolova jos 5 dugmeca sa koi biram koi stolovi cu prikazati .
Za svako jedno dugme imam po 50 stolova i mislim da je to sasvim dovolno .
Prilozi:
untitled.bmp (Veličina: 1.47 MB)

kenan 29.06.2017-14:17
Subject: Re: Raspored kucica

to je to otprilike samo što sam ja, mislim ukrao tvoju proceduru za automatsko kreiranje dugmadi iz tabele i to mi radi perfektno samo kako da to dalje rasporedim po kolonama neide mi
evo ti procedura

Private Sub cmdAddLabel_Click()
Dim myFrmFont As String, frmName As String
Dim CTR As control, ctlText As control, CTR1 As control
Dim intDataX As Integer, intDataY As Integer
Dim intLabelX As Integer, intLabelY As Integer

myFrmFont = "MPSalaPrikaz"
frmName = myFrmFont
Dim B As CommandButton
DoCmd.Close acForm, frmName, acSaveYes
DoCmd.OpenForm frmName, acDesign, , , , acHidden
Dim Naziv As String

Dim CT As String

PONOVO:
For Each CTR In Forms![MPSalaPrikaz]
If CTR.ControlType = acCommandButton Then
CT = CTR.Name
DeleteControl frmName, CT
DoEvents
End If
Next

If Forms![MPSalaPrikaz].Controls.Count <> 0 Then GoTo PONOVO

DoCmd.Close acForm, frmName, acSaveYes

DoCmd.OpenForm frmName, acDesign, , , , acHidden
Dim LstLbl As String
Dim Top1, Left1, Height1, Width1, LeftNew As Long
Dim FName, FColor, FSize As String
Top1 = 200
Left1 = 200
Height1 = 1100
Width1 = 1100
Dim DB As DAO.Database
Dim RS As DAO.Recordset
Dim RS3 As DAO.Recordset
Set DB = CurrentDb()
Set RS = DB.OpenRecordset("SELECT ZFStol.Sala FROM ZFStol WHERE (((ZFStol.IDOrg)=IDOrg())) GROUP BY ZFStol.Sala;")
With RS
.MoveFirst
Do While Not .EOF
Set CTR = CreateControl(frmName, acCommandButton, acDetail, "", "", Left1, Top1, Width1, Height1)
With CTR
.Name = "Sala" & RS(0)
.Caption = "Sala " & RS(0)
' If IsNull(RS(8)) Then Else .Picture = RS(8)
.BackStyle = 1 '1 "Normal" 0 FLET
.BackColor = vbRed '16777215
' .Tag = RS(0)
Set mdlThisFormsModule = Forms![MPSalaPrikaz].Module
.OnClick = "[Event Procedure]"
Set RS3 = DB.OpenRecordset("SELECT ZFStol.Stol, ZFStol.IDSlol FROM ZFStol WHERE ((not (ZFStol.Sala)=" & RS(0) & ") AND ((ZFStol.IDOrg)=IDOrg())) GROUP BY ZFStol.Stol, ZFStol.IDSlol;", dbOpenDynaset, dbSeeChanges)
strSub = "Private Sub Sala" & RS(0) & "_Click()" & vbNewLine
mdlThisFormsModule.InsertLines mdlThisFormsModule.CountOfLines + 1, strSub
RS3.MoveFirst
Do While Not RS3.EOF
strSub1 = "Stol" & RS3(1) & ".visible=false" & vbNewLine
mdlThisFormsModule.InsertLines mdlThisFormsModule.CountOfLines + 1, strSub1
RS3.MoveNext
Loop
RS3.Close
Set RS3 = DB.OpenRecordset("SELECT ZFStol.Stol, ZFStol.IDSlol FROM ZFStol WHERE (((ZFStol.Sala)=" & RS(0) & ") AND ((ZFStol.IDOrg)=IDOrg())) GROUP BY ZFStol.Stol, ZFStol.IDSlol;", dbOpenDynaset, dbSeeChanges)
RS3.MoveFirst
Do While Not RS3.EOF
strSub2 = "Stol" & RS3(1) & ".visible=true" & vbNewLine
mdlThisFormsModule.InsertLines mdlThisFormsModule.CountOfLines + 1, strSub2
RS3.MoveNext
Loop
RS3.Close
' strSub3 = "PromjenaVelicineUG" & vbNewLine
strSub4 = "End Sub"
mdlThisFormsModule.InsertLines mdlThisFormsModule.CountOfLines + 1, strSub4
End With
Top1 = (Top1 + 200) + Height1
'---------------------------------------------
-------
Dim Top2, Left2, Height2, Width2 As Long
' Dim FName, FColor, FSize As String
Top2 = 200
Left2 = 2000
Height2 = 1500
Width2 = 1500
Dim RS1 As DAO.Recordset
' Set DB = CurrentDb()
Set RS1 = DB.OpenRecordset("SELECT ZFStol.Stol, ZFStol.IDSlol FROM ZFStol WHERE (((ZFStol.Sala)=" & RS(0) & ") AND ((ZFStol.IDOrg)=IDOrg())) GROUP BY ZFStol.Stol, ZFStol.IDSlol;", dbOpenDynaset, dbSeeChanges)
If RS1.RecordCount = 0 Or IsNull(RS1.RecordCount) Then
MsgBox "radi" & RS1(0)
Else
With RS1
.MoveFirst
Do While Not .EOF
Set CTR1 = CreateControl(frmName, acCommandButton, acDetail, "", "", Left2, Top2, Width2, Height2)
With CTR1
.Name = "Stol" & RS1(1)
.Caption = "Stol " & RS1(0)
' If IsNull(RS(8)) Then Else .Picture = RS(8)
.BackStyle = 1 '1 "Normal" 0 FLET
.BackColor = vbRed '16777215
.fontsize = 16
.FontName = "Calibri (Detail)"
.Tag = RS1(0)
.visible = False
.OnClick = "[Event Procedure]"
strSub = "Private Sub Stol" & RS1(1) & "_Click()" & vbNewLine & _
"docmd.openform ""MPBlagajnaUG""" & vbNewLine & _
"form_MPBlagajnaUG!IDstol=" & RS1(1) & vbNewLine & _
"form_MPBlagajnaUG!sala=" & RS(0) & vbNewLine & _
"form_MPBlagajnaUG!stol=" & RS1(0) & vbNewLine & "End Sub"
' Create the event.
mdlThisFormsModule.InsertLines mdlThisFormsModule.CountOfLines + 1, strSub
End With
Top2 = (Top2 + 200) + Height2
.MoveNext
Loop
.Close
End With
End If
'---------------------------------------------
-------
.MoveNext
Loop
.Close
End With
DB.Close
' Create unbound default-size text box in Header section.
DoCmd.Close acForm, frmName, acSaveYes
'DoCmd.Close acForm, Me.Name, acSaveYes
DoCmd.OpenForm frmName

kenan 29.06.2017-14:18
Subject: Re: Raspored kucica

i usput ako neko zna trebala bi mi pomoc pošto dopunjavam formin modul ako ga obrisati podatke iz modula

Gjoreski 29.06.2017-15:05
Subject: Re: Raspored kucica

Ti si ovo previse iskomplikovao.Mislim da ovo nece ti raditi kad napravis mde od aplikacije,to sam i ranie pisao.
Bolje napravi dugmeta i stavi ih da budu nevidlive i samo po potreba ih prikazujes.
Drugi nacin je da ovo sve pravis u VB gdje mozes praviti dinamicke dugmeca.

Gjoreski 29.06.2017-15:05
Subject: Re: Raspored kucica

Ti si ovo previse iskomplikovao.Mislim da ovo nece ti raditi kad napravis mde od aplikacije,to sam i ranie pisao.
Bolje napravi dugmeta i stavi ih da budu nevidlive i samo po potreba ih prikazujes.
Drugi nacin je da ovo sve pravis u VB gdje mozes praviti dinamicke dugmeca.