New fields do not Show (1 Viewer)

sysHvV

Registered User.
Local time
Today, 11:18
Joined
Jun 13, 2005
Messages
20
Recently I added a few fields to an existing ACCESS form but I am not able to make them visible on my screen. View the code,

Code:
Recentl
    If TrefCountE > 0 Then
        moSQL = "SELECT * FROM SeekTitleQry WHERE [TrefID]=" & TrefKiesE
        moDummy = ArtistSeek(moSQL, "Ignore")
    End If
    If TrefCountF > 0 Then
        moSQL = "SELECT * FROM SeekTitleQry WHERE [TrefID]=" & TrefKiesF
        moDummy = ArtistSeek(moSQL, "Ignore")
    End If
    strLink = "Choice =" & moKeuze
    DoCmd.OpenForm stDocName, , , strLink
    
    If TrefCountA > 0 Then
        Forms!FviTitelList!ExplA = TrefKiesA.Column(1)
        Forms!FviTitelList!ExplB = TrefKiesB.Column(1)
        Forms!FviTitelList!ExplC = TrefKiesC.Column(1)
===============================================
        Forms!FviTitelList!ExplD = TrefKiesD.Column(1)
        Forms!FviTitelList!ExplE = TrefKiesE.Column(1)
        Forms!FviTitelList!ExplF = TrefKiesF.Column(1)

    End If
    With Form_FviTitelList
            .SwitchScherm False
            .Repaint
    End With
The top fields (the old ones) are perfect but I did not manage to show the fields D trough F. The functionality is not hampered at all.
Pleas Help

_________________________________________________________
Beauty resides in the eye of the beholder
Configuration
MoBO – Asus P5QLD S775
OS = Windows 7 Home Premium (Still an enigma to me)
Video Saphire Radeon HD5450
Intel Core 2 Quad Q9550 at 2.66 GHZ
RAM = 4.00 GB
Office 97
Visual Basic 2008
 

RainLover

VIP From a land downunder
Local time
Today, 19:18
Joined
Jan 5, 2009
Messages
5,041
There is too much information missing in order to gain a full appreciation of what is going on.

Can you please post the whole Procedure. Or better still post a cut down version of your Database.
 

sysHvV

Registered User.
Local time
Today, 11:18
Joined
Jun 13, 2005
Messages
20
There is too much information missing in order to gain a full appreciation of what is going on.

Can you please post the whole Procedure. Or better still post a cut down version of your Database.

Greetings to Australia

Herewith the whole code section of the ‘Class Module FviTitelSel’ my native tongue is Dutch and the naming of the various procedures corresponds to that but there is a mixture with English.
A brief explication of abbreviations and translations:
FviTitelSel = F(orm)vi(deo)TitelSel(ection).
TrefKiesA = HitsChoice(A = Rank)
TrefCountA = HitsCount(A = Rank)
MoKeuze = Choice

The concept of the Database goes back to a number of school communities and was originally intended to facilitate the exchange of books from their various libraries. The Database is located on one of the Communities servers and can only be accessed with a valid student or teacher pass. Although 15 years old it always kept its original shape (also due to poor funding).



This screen corresponds to the whole module dedicated to selecting out the videos that meet your demands, the yellow fields are desired and the RED fields are NOT desired. After selecting one TrefCountX tells you how many records are found meeting that choice. Until you click ‘Selectie Uitvoeren’ = OK you may change the aforementioned. After that a screen opens showing the desired records in the Database which maybe zero.
Everything works fine except for the recently added three they do not hamper anything but just are not visible on the screen .

From your name I gathered that your habitat is one of Australia’s drought stricken areas so while I wish you will get the desired amount of water. No worries Mate.

Code:
Option Compare Database
Option Explicit
Dim moDummy, moCountSelect As Integer, moSQL As String, moKeuze As Integer, moTrefAll As Boolean

Private Sub buCloseForm_Click()
On Error GoTo Err_buCloseForm_Click

    DoCmd.Close

Exit_buCloseForm_Click:
    Exit Sub

Err_buCloseForm_Click:
    MsgBox Err.Description
    Resume Exit_buCloseForm_Click
    
End Sub

Private Sub buFilterOff_Click()
    TrefKiesA = 0
    TrefKiesB = 0
    TrefKiesC = 0
    TrefKiesD = 0
    TrefKiesE = 0
    TrefKiesF = 0
    TrefCountA = 0
    TrefCountB = 0
    TrefCountC = 0
    TrefCountD = 0
    TrefCountE = 0
    TrefCountF = 0
End Sub

Private Sub buSelector_Click()
On Error Resume Next

    Dim stDocName As String, stSeek As String, strLink As String
    Dim DBS As Database, RST As Recordset

    If TrefKiesA < 2 And TrefKiesB < 2 And TrefKiesC < 2 Or moKeuze < 1 Then
        MsgBox "Je moet tenminste èèn Trefwoord selecteren!", vbCritical, "Selectie Uitvoeren"
        Exit Sub
    End If
    stDocName = "FviTitelList"
    moSQL = "SELECT * FROM SeekTitleQry WHERE [Choice] <> 0"
    moDummy = ArtistSeek(moSQL, "Reset")
    moKeuze = 0
    '' Set First Group
    If TrefCountA > 0 Then
        moSQL = "SELECT * FROM SeekTitleQry WHERE [TrefID]=" & TrefKiesA
        moDummy = ArtistSeek(moSQL, "Add")
        moKeuze = moKeuze + 1
    End If
    If TrefCountB > 0 Then
        moSQL = "SELECT * FROM SeekTitleQry WHERE [TrefID]=" & TrefKiesB
        moDummy = ArtistSeek(moSQL, "Add")
        moKeuze = moKeuze + 1
    End If
    If TrefCountC > 0 Then
        moSQL = "SELECT * FROM SeekTitleQry WHERE [TrefID]=" & TrefKiesC
        moDummy = ArtistSeek(moSQL, "Add")
        moKeuze = moKeuze + 1
    End If
    If TrefCountD > 0 Then
        moSQL = "SELECT * FROM SeekTitleQry WHERE [TrefID]=" & TrefKiesD
        moDummy = ArtistSeek(moSQL, "Add")
        moKeuze = moKeuze + 1
    End If
    If TrefCountE > 0 Then
        moSQL = "SELECT * FROM SeekTitleQry WHERE [TrefID]=" & TrefKiesE
        moDummy = ArtistSeek(moSQL, "Ignore")
    End If
    If TrefCountF > 0 Then
        moSQL = "SELECT * FROM SeekTitleQry WHERE [TrefID]=" & TrefKiesF
        moDummy = ArtistSeek(moSQL, "Ignore")
    End If
    strLink = "Choice =" & moKeuze
    DoCmd.OpenForm stDocName, , , strLink
    
    If TrefCountA > 0 Then
        Forms!FviTitelList!ExplA = TrefKiesA.Column(1)
        Forms!FviTitelList!ExplB = TrefKiesB.Column(1)
        Forms!FviTitelList!ExplC = TrefKiesC.Column(1)
        Forms!FviTitelList!ExplD = TrefKiesD.Column(1)
        Forms!FviTitelList!ExplE = TrefKiesE.Column(1)
        Forms!FviTitelList!ExplF = TrefKiesF.Column(1)

    End If
    With Form_FviTitelList
            .SwitchScherm False
            .Repaint
    End With
    
    ''Forms!FviTitelList!Debug = strLink
    ''If CountTitel < 1 Then
    ''    MsgBox "Er is niets gevonden met deze combinatie van Trefwoorden!", vbExclamation, "Selectie Uitvoeren"
    ''    Me.FilterOn = False
        ''Exit Sub
    ''End If
    
End Sub

Private Function ArtistSeek(strSeek As String, Modus As String)
On Error Resume Next
    Dim DBS As Database, RST As Recordset
    Dim mySel As Integer

    Set DBS = CurrentDb
    Set RST = DBS.OpenRecordset(strSeek)
    While Not RST.EOF
        Select Case Modus
            Case "Reset"
                mySel = 0
            Case "Ignore"
                mySel = 999
            Case Else
                mySel = RST("Choice") + 1
        End Select
        RST.Edit
        RST("Choice") = mySel
        RST.Update
        RST.MoveNext
    Wend
    RST.Close
    DBS.Close
End Function

Private Sub Form_Load()
On Error Resume Next
    TrefKiesA = 0
    TrefKiesB = 0
    TrefKiesC = 0
    TrefKiesD = 0
    TrefKiesE = 0
    TrefKiesF = 0
    TrefCountA = 0
    TrefCountB = 0
    TrefCountC = 0
    TrefCountD = 0
    TrefCountE = 0
    TrefCountF = 0
    moKeuze = 0
End Sub

Private Sub TrefKiesA_AfterUpdate()
On Error Resume Next

    Me.TrefCountA = ""
    If Me.TrefKiesA > 1 Then Me.TrefCountA = TrefWordCount(TrefKiesA)
    moKeuze = 1
    buSelector.SetFocus
    
End Sub

Private Sub TrefKiesA_DblClick(Cancel As Integer)
On Error Resume Next

    moKeuze = 0
    TrefKiesA = 0
    TrefCountA = 0
End Sub

Private Sub TrefKiesB_AfterUpdate()
On Error Resume Next

    TrefCountB = 0
    If TrefKiesB > 1 Then TrefCountB = TrefWordCount(TrefKiesB)
    moKeuze = 2
    buSelector.SetFocus
End Sub

Private Sub TrefKiesB_DblClick(Cancel As Integer)
On Error Resume Next

    moKeuze = 1
    TrefKiesB = 0
    TrefCountB = 0
End Sub

Private Sub TrefKiesC_AfterUpdate()
On Error Resume Next

    TrefCountC = 0
    If TrefKiesC > 1 Then TrefCountC = TrefWordCount(TrefKiesC)
    moKeuze = 3
    buSelector.SetFocus
End Sub

Private Sub TrefKiesC_DblClick(Cancel As Integer)
On Error Resume Next

    moKeuze = 2
    TrefKiesC = 0
    TrefCountC = 0
End Sub

Private Sub TrefKiesD_AfterUpdate()
On Error Resume Next

    TrefCountD = 0
    If TrefKiesD > 1 Then TrefCountD = TrefWordCount(TrefKiesD)
    moKeuze = 3
    buSelector.SetFocus
End Sub

Private Sub TrefKiesD_DblClick(Cancel As Integer)
On Error Resume Next

    moKeuze = 2
    TrefKiesD = 0
    TrefCountD = 0
End Sub

Private Sub TrefKiesE_AfterUpdate()
On Error Resume Next

    TrefCountE = 0
    If TrefKiesE > 1 Then TrefCountE = TrefWordCount(TrefKiesE)
    moKeuze = 2
    buSelector.SetFocus
End Sub

Private Sub TrefKiesE_DblClick(Cancel As Integer)
On Error Resume Next

    moKeuze = 1
    TrefKiesE = 0
    TrefCountE = 0
End Sub

Private Sub TrefKiesF_AfterUpdate()
On Error Resume Next

    TrefCountF = 0
    If TrefKiesF > 1 Then TrefCountF = TrefWordCount(TrefKiesF)
    moKeuze = 2
    buSelector.SetFocus
End Sub

Private Sub TrefKiesF_DblClick(Cancel As Integer)
On Error Resume Next

    moKeuze = 1
    TrefKiesF = 0
    TrefCountF = 0
End Sub

Private Function TrefWordCount(wordID As Long) As Integer
    Dim DBS As Database, RST As Recordset, strSeek As String

    strSeek = "SELECT * FROM MedTrefWrdQry WHERE [TrefID] =" & wordID
    Set DBS = CurrentDb
    Set RST = DBS.OpenRecordset(strSeek)
    If RST.RecordCount > 0 Then
        RST.MoveLast
        TrefWordCount = RST.RecordCount
    End If
    RST.Close
    DBS.Close

End Function
 

RainLover

VIP From a land downunder
Local time
Today, 19:18
Joined
Jan 5, 2009
Messages
5,041
Forms!FviTitelList!ExplA = TrefKiesA.Column(1)
Forms!FviTitelList!ExplB = TrefKiesB.Column(1)
Forms!FviTitelList!ExplC = TrefKiesC.Column(1)
Forms!FviTitelList!ExplD = TrefKiesD.Column(1)
Forms!FviTitelList!ExplE = TrefKiesE.Column(1)
Forms!FviTitelList!ExplF = TrefKiesF.Column(1)

What are "TrefKiesA" etc.

Are they Controls on a Form or Fields in a Query/Table.

Looking at what you have if "Forms!FviTitelList!ExplA " works then so should everything else.

Are they named properly on the Form?

When you say they are not Visible, are you refering to the Text Box or the Data that should be in the Text Box.

PS.

Rain Lover was a Famous Race Horse. He won two Melbourne Cups which is one of the world's most famous races.

As far as our weather. We came out of drought two years ago. We are currently experiencing Floods. Australia is so big in size that in one place we can have floods, another drought while another may be suffering Fire. It can be 40c in one place and snowing in another.

Hope you get to visit us sometime.
 
Last edited:

sysHvV

Registered User.
Local time
Today, 11:18
Joined
Jun 13, 2005
Messages
20
What are "TrefKiesA" etc.

Are they Controls on a Form or Fields in a Query/Table.

Looking at what you have if "Forms!FviTitelList!ExplA " works then so should everything else.

Are they named properly on the Form?

When you say they are not Visible, are you refering to the Text Box or the Data that should be in the Text Box.

PS.

Rain Lover was a Famous Race Horse. He won two Melbourne Cups which is one of the world's most famous races.

As far as our weather. We came out of drought two years ago. We are currently experiencing Floods. Australia is so big in size that in one place we can have floods, another drought while another may be suffering Fire. It can be 40c in one place and snowing in another.

Hope you get to visit us sometime.

To answer your question: the fields you mention are independent rolldown selectors and the fields underneath are mere text fields set to numeric.
Gladly I can tell you that I solved the problem myself, in a brief bright moment I decided to inspect the master module where from this subform is called upon:
Form FviTitelList
subForm FviTitelSel
Public Sub SwitchScherm = (SwapScreen)
I simply added those fields and everything works fine, must have been asleep while programming.
Sincere thanks for your effort.

When in Holland please look me up.

Code:
Public Sub SwitchScherm(Modus As Boolean)

    Select Case Modus
        Case True
            ExplA.Visible = False
            ExplB.Visible = False
            ExplC.Visible = False
            ''KiesZoeken.Visible = True
            ''lblSeek.Visible = True
        Case False
            ExplD.Visible = True
            ExplE.Visible = True
            ExplF.Visible = True
            ''KiesZoeken.Visible = False
            ''lblSeek.Visible = False
    End Select

End Sub

Public Sub SwitchScherm(Modus As Boolean)

    Select Case Modus
        Case True
            ExplA.Visible = False
            ExplB.Visible = False
            ExplC.Visible = False
            ExplD.Visible = False
            ExplE.Visible = False
            ExplF.Visible = False
            ''KiesZoeken.Visible = True
            ''lblSeek.Visible = True
        Case False
            ExplA.Visible = True
            ExplB.Visible = True
            ExplC.Visible = True
            ExplD.Visible = True
            ExplE.Visible = True
            ExplF.Visible = True
            ''KiesZoeken.Visible = False
            ''lblSeek.Visible = False
    End Select

End Sub
 

RainLover

VIP From a land downunder
Local time
Today, 19:18
Joined
Jan 5, 2009
Messages
5,041
Glad to hear you solved the problem.
 

Users who are viewing this thread

Top Bottom