Recent content by ZikO

  1. Z

    Date type conversion -

    Hi I have ACCESS2010 and reside in UK so I use European format. How about extracting particular digits corresponding to days and months and convert them to proper date format? I tried the code below and it worked but the function Format() in my ACCESS version accepts dd/mm/yyyy as a default...
  2. Z

    Looping through a recordset

    2) In order to update a table via recordset, I think you use have to run method .Edit. Then after you are done you need to finish by running .Update. Once you have done both, the table should be updated. 3) I use rs![field name] to refer to a field name in a recordset. If I need to parametrise...
  3. Z

    Items in a List Box are deselected when clicking on them.

    Ok, I sorted out the problem. This is the new code: Option Compare Database Option Explicit Private Sub Form_Current() Me.lbListBox = Me!ID End Sub Private Sub lbListBox_Click() Dim rs As DAO.Recordset Dim indx As Long Set rs = Me.RecordsetClone If Not rs.BOF And Not...
  4. Z

    Items in a List Box are deselected when clicking on them.

    Hi. It converts down to Access 2003 but without the form; it is always removed. I cannot figure out why. Sorry. EDIT. I've just tried to create similar form working with a compatible format file (access 2002-2003) but it does not save the form. It's beyond my comprehension :(
  5. Z

    Items in a List Box are deselected when clicking on them.

    Hi I have added a list box to a form with Single Selection mode on. Its purpose is to improve the interface. It contains items that represent all records. Clicking on the list box causes the form to jump to another record. The problem is following: if I click on the List Box, it clears the...
  6. Z

    Question on Variables

    It's an interesting problem :) In C++ you can do this: int A; int& B = A; In doing so, B refers to A meaning they share the same address and whatever is assigned to B will change A, either. I don't know how to do it in VBA. What I know is you can define arguments in Sub/Function that will...
  7. Z

    How/where to initialize a global variables

    Thanks guys. I trierd the frmInitialize and it worked but Frothingslosh's solution is also very good. I made a global function where I initialize global variables and then open the navigation form. It's working now. THanks for help :)
  8. Z

    How/where to initialize a global variables

    The order the code runs is following: Sub Form, OnOpen Sub Form, OnLoad Main Form, OnOpen Main Form, OnLoad Navigation Form, OnOpen Navigation Form, OnLoad Initialize Globals (executed in AutoExec) I did try "frmInitialize" that is a simple form without anything but OnLoad code and AutoExec...
  9. Z

    How/where to initialize a global variables

    Hi pr2-eugin, Thanks for your answer. I test when AutoExec runs when I open the database and it seems to be when everything is loaded, subform, main form and at last Nav form. I checked that putting comments in OnLoad and OnOpen event codes. It does not work for me. I need to initialize...
  10. Z

    How/where to initialize a global variables

    Hello, I have the main form 'frmMain' with a subform, e.g. frmSubform and a few global variables such as 'bAreTextBoxesLocked' (boolean) and 'collcolorThemes' (Collection) in a module. I created a public procedure in this module where I initialize them. Then I need the main form and the sub...
  11. Z

    Automated / transparent conversion in text box control

    Hi David Thanks for this clue. It helped :)
  12. Z

    Automated / transparent conversion in text box control

    Hi everyone, I am looking for an advice in this thread. I have a text box control in a form that is bound to a table field. The field is of numeric format that stores time duration in minutes. I would like to apply sort of transparent / automated conversion. It would work so follows: - when...
  13. Z

    Fields required for table cause error

    Hi I did try my best to explain the problem in details. I am sorry if I failed. I sorted this out anyway so I am going to explain what's happened. The form I have been talking about is inside a navigation form and contains another subform. The form is bound to one of the tables that has fields...
  14. Z

    Fields required for table cause error

    Hi Guys, I have a table, let's say tblBooking with only three ID fields that are foreign keys from other tables and are required. The form frmBooking which is bound to this table has three combo boxes. Each combo box substitutes informative text with correct ID. The form is placed in a...
  15. Z

    Form not updated after adding a record

    Hi, I've looked at the database again. You have mentioned here that it was not the way you would do it. Could you share your opinions here? I am sorry for this question but I am still learning programming and designing databases. I hope it is not a problem. Cheers! @RainLover Thanks for the...
Top Bottom