27/05/2017, 23:28
Arkadaşlar merhaba "masa-1" de açılmış hesabı "MASAISLEMLERI" formunda buton yardımı ile "masa-2 veya diğerleri" nasıl taşınabilir?
Sub RenkYenile()
Dim GSayim As Integer
Dim GMasam As String
For GSayim = 1 To 21
GMasam = "MASA" & GSayim
If Dlookup ("MASADURUMU", "MASALAR", "[MASAID]=" & GSayim) = "DOLU" Then
Forms![HOME](GMasam)![MASAADI].BackColor = 65535
Else
Forms![HOME](GMasam)![MASAADI].BackColor = vbWhite
End If
Next GSayim
End Sub
Call RenkYenile
Option Compare Database
Option Explicit
Private Sub btn_masaaktar_Click()
Dim GAdisyonNo, GMasaId As Integer
Dim GMasaAdi As String
GAdisyonNo = mtn_adisyonno
GMasaId = Me.acl_bosmasalar
GMasaAdi = Me.acl_bosmasalar.Column(1)
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE MASAISLEMLERI SET MASAID = " & GMasaId & " , MASAADI = '" & GMasaAdi & "' WHERE (((ISLEMID)= " & GAdisyonNo & "));"
DoCmd.RunSQL "UPDATE MASALAR SET MASADURUMU = 'BOŞ' WHERE (((MASAADI)= '" & mtn_masaadi & "' ));"
DoCmd.RunSQL "UPDATE MASALAR SET MASADURUMU = 'DOLU' WHERE (((MASAID)= " & GMasaId & " ));"
DoCmd.SetWarnings True
Call RenkYenile
MsgBox ("Masa Aktarımı Tamamlandı")
DoCmd.OpenForm "MASAISLEMLERI", , , "[MASAID]=" & [acl_bosmasalar]
Forms![MASAISLEMLERI]!Metin40 = GMasaAdi
Forms![MASAISLEMLERI]!GELENMASAADI = GMasaAdi
DoCmd.Close acForm, "frm_masaaktar"
End Sub
Sub RenkYenile()
Dim GSayim As Integer
Dim GMasam As String
For GSayim = 1 To 21
GMasam = "MASA" & GSayim
If Dlookup ("MASADURUMU", "MASALAR", "[MASAID]=" & GSayim) = "DOLU" Then
Forms![HOME](GMasam)![MASAADI].BackColor = 65535
Else
Forms![HOME](GMasam)![MASAADI].BackColor = vbWhite
End If
Next GSayim
End Sub