Made qtrCode
Code:
Dim dbCode As DAO.Database
Dim rstCode As DAO.Recordset
Dim I As Integer
Dim CodeX As String
Set dbCode = CurrentDb
Set rstCode = dbCode.OpenRecordset("qtrCode")
rstCode.FindFirst "MainID = " & Me.MainID
For I = 1 To 10
CodeX = "Code" & I
rstCode(CodeX).Value = "0"...
And how can i point at that row inside the tblCode where MainID is the same???
Without a query...
I need to point in that row and then add data to Code1, Code2,...
tblCode
CodeID
MainID
Code1
..
Code10
i found that :
If DLookup("MainID", "tblCode", "MainID = " & Me.MainID) = Me.MainID
is working fine...
MainID is always a number and never null or 0... it is autonumber...
Is it going to work always right???
From my little vba...
code:
If DLookup("MainID", "tblCode", "MainID" = Me.MainID) = True Then
'do something
Else
'do something
End If
Is this ok... i test it and it always go to Else...
If tblcode.mainID is the same with frmMainID = True then do something
Forgot..
tblMain
MainID, AutoNumber
Main1, Number
Main2, Number
CodeID, AutoNumber
MainID, Number
Code1, Number
...
Code10, Number
frmMain
MainID
Main1
Main2
and bt1 as Button
All are numbers...
Hi,
Where i am making a mistake???
Code:
Private Sub btn1_Click()
Dim dbCode As DAO.Database
Dim rstCode As DAO.Recordset
Set dbCode = CurrentDb
Set rstCode = dbCode.OpenRecordset("tblCode")
Dim strCheck As String
strCheck = Me.MainID.Value
With rstCode
.FindFirst "[MainID]=" & strCheck...
How can i make it works in with continuous forms???
I tested the code in a form with 10buttons and works great...
But when i tried it with continuous forms all rows where the same...
How to make it works for each row...??
Thxs for your reply...
Found it...
Code:
Sub AllShow()
Dim ctrlx As Control
Dim x As Integer
Dim Showx As String
For i = 1 To 10
Showx = "btn" & i
For Each ctrl In Me.Controls
If ctrl.ControlName = Showx Then
ctrl.Visible = True
End If...