Search results

  1. R

    Solved loop all controls

    you mean the the tables?
  2. R

    Solved loop all controls

    I think I have figure it out. I have copied all the controls, tables, hole project and distroyed the labels connection via macro. Now I enumarete the labels like lab0, lab2 according to the table records. And now it is working. However I still get the error like above lbl.OnClick =...
  3. R

    Solved loop all controls

    Ok. Option Compare Database Option Explicit Private Const LABEL_PREFIX As String = "Etykieta" Public Function wstaw() 'funkcja sprawdza na wejściu czy jest "paid" wypłęnione. jeśli nie zwraca komnikat i zmienia kolor If Len(Me.paid.Value & vbNullString) = 0 Then...
  4. R

    Solved loop all controls

    I cannot understand why I go this same error lbl.OnClick = "=LabelClick(" & Mid(lbl.Name, Len(LABEL_PREFIX) + 1) & ")" . The statement has got invalid syntax
  5. R

    Solved loop all controls

    Well the line was commented. Normally when I press label it directes me to the record. DoCmd.GoToRecord , , acGoTo, 1. Is there any relation to this?
  6. R

    Solved loop all controls

    It is strange. When I do new form with the same as you it works. Normalny when you press label0 etc the DoCmd.GoToRecord , , acGoTo, 25 id fired. It is strange it work and now not:unsure:
  7. R

    Solved loop all controls

    Ok I will try to explain. Before saving the project it worked exactly I wanted to. When I have saved the project and repopened it it gave me an erro lbl.OnClick = "=LabelClick(" & Mid(lbl.Name, Len(LABEL_PREFIX) + 1) & ")" . The statement has got invalid syntax Private Sub Form_Load()...
  8. R

    Solved loop all controls

    Yeah i could work as well. Suprisingly when I have saved and reopened the problem has accured lbl.OnClick = "=LabelClick(" & Mid(lbl.Name, Len(LABEL_PREFIX) + 1) & ")" Problem with not propriate method
  9. R

    Solved loop all controls

    OK. Works with some modification. Private Sub Form_Load() DoCmd.Maximize Dim lbl As Access.Control For Each lbl In Me.Controls lbl.OnClick = "=LabelClick(" & Mid(lbl.Name, Len(LABEL_PREFIX) + 1) & ")" Next End Sub Private Function LabelClick(idx As Integer) As Boolean...
  10. R

    Solved loop all controls

    I have change the private constant to the label that exists. However in else part I got the error that object doesn`t support this method For Each lbl In Me If lColour >= 0 Then If Not lbl.BackColor = lColour Then lbl.BackColor = lColour If Not lbl.BackStyle = 1 Then...
  11. R

    Solved loop all controls

    Dear cheekybudha. I have checked your code it is working. when I try to djust to my project I got the erro like above: with me. problem I suppose it shoould be Me.cotrols. ALso i this part I got the problem For Each lbl In Me If lColour >= 0 Then If Not lbl.BackColor = lColour...
  12. R

    Solved loop all controls

    I thought lbl is not set to the existing labels so I have used: Dim lbl As Label lbl = Me.Controls("Etykieta" & idx) but after that I got the run-time error:2465, it says the labels which lbl referst to do not match "Etykieta-1". But in real Etykieta1 exists since "Etykieta-1" not I have...
  13. R

    Solved loop all controls

    the problem appears For Each lbl In Me in SetLabelColour function and also in For Each lbl In Me lbl.OnClick = "=LabelClick(" & Mid(lbl.Name, 4) & ")" Next first line in Form_load
  14. R

    Solved loop all controls

    Thanks for the reply. I have tried your code but I got some run-time error: 13. Maybe I am too "green" to resolve it. the function "LabelClick" I am calling from the curent form. What coudl be wrong?
  15. R

    Solved loop all controls

    Sorry for mess. This is single form. About elaboration. I have let's say 100 labels. I can do backstyle and backcolor for all just with one loop. The labels work like a button when I press I want ut to use "zmienKolor" Function and change the clicked label to yellow. I have the labels called...
  16. R

    Hi.

    Grazie mile Nautical. Mi piace conoscerti ...
  17. R

    Solved loop all controls

    Hi I am trying to resolve the problem of my work. I have program that is searching through the database. I have a lot of controls labels. I want to change the specific label color by looping. This works for all controls to disable the color. It is OK. on current form action Public Function...
  18. R

    Hi.

    I am pretty new in access. I am trying to learn some more.
Back
Top Bottom