Search results

  1. W

    assigning value to variable

    Great! And how does it work with subform control?
  2. W

    assigning value to variable

    Thank you. If there is no shorter way, i am going to use this. Works perfectly thanks
  3. W

    assigning value to variable

    no it is not. May be to ask differently: how to avoid to retype every time the part of the code that is repeated. s=Forms!frm1.controlname keep Forms!frm1 and let the controlname change like this s=Forms!frm1 ss=s & controlname1 ss=s & controlname2 etc
  4. W

    assigning value to variable

    Not quite... ss=s & controlname This does not work.
  5. W

    assigning value to variable

    I got it working s=Forms("Your form name").Controls(controlname) controlname="Your Control name1" controlname="Your Control name2" controlname="Your Control name3" Thanks for the help!
  6. W

    assigning value to variable

    It works fine, but when i split it, it fails. The Control name is the one that changes, so what i would like is something like this: s=Forms("Your form name").Controls & controlname whereas controlname=Your Control name1 controlname=Your Control name2 controlname=Your Control name3
  7. W

    assigning value to variable

    Hi, I am trying to shorten the code but i am not sure if it is possible at all, since error is created. What i am trying to accomplish is to use a string that is repeated in several times while the values of the variables are passed from an other open form like this: open form is: Forms!frm1 x...
  8. W

    Passing Array to Sub

    Thank you i will.
  9. W

    Passing Array to Sub

    I have got it worked, marking all records in subform. Private Sub cmdMarkAll_Click() Dim mark() As Variant Dim markall As Recordset Set markall = CurrentDb.OpenRecordset("SELECT mark FROM tbTransactions") markall.MoveLast markall.MoveFirst mark = markall.GetRows(markall.RecordCount) markRC =...
  10. W

    Passing Array to Sub

    Thank you, i understand now
  11. W

    Passing Array to Sub

    Thank you so much. I understand. Actually what i want is to have a button on a main form to select all records in subform. Do you have any suggestion theh?
  12. W

    Passing Array to Sub

    Thank you but i am still do not get it. This the function to create the array and populate with a recordset Function txArray1() Dim tx As Recordset Dim strMarked As String Dim txList() Dim txType As String strMarked = "SELECT * FROM tbTransactions WHERE tx_Status=''" Set tx =...
  13. W

    Passing Array to Sub

    Hi, I have a form/subform object. For some functions i use arrays. In order to make it simplier i try to make a function in a modul that creates the array and then call this function in the forms sub to perform specific task like marking records shown in subform. It would look like this...
  14. W

    OnClick argument

    i see thank you, i thought so but was not sure. Thanks
  15. W

    OnClick argument

    Hi, Just came across this. How the OnClick event argument can be used in case of CommandButton.OnClick event? thanks Andrew
  16. W

    Passing global/public variable between forms

    Thanks for all these inputs! You all just answered my question. Thanks again
  17. W

    Passing global/public variable between forms

    i have gotten it working with the following method. Created a module: Option Compare Database Global strT As String Public Sub test() strT = "Public Variable Test" End Sub Then i call this module in Form1: Option Compare Database Global strT As String Public Sub test() strT = "Public Variable...
  18. W

    Passing global/public variable between forms

    Hi, I know old question but i would like to ask for clarification. I have two forms:Form1 and Form2. I want to pass varible created in Form1 to Form2. If Form1 stays open it works, but if i close it it does not. So code behind it Form1 Option Compare Database Option Explicit Public strT As...
  19. W

    Public variable declaration

    ok thank you!
  20. W

    Public variable declaration

    Thank you, i corrected my mistake. I have put the public variable declaration into a module and it works fine thank you!
Back
Top Bottom