Search results

  1. R

    Date Problem in Forms

    Now I'm confused! (more so than usual :)) If you only have one record with only one field, why not use a calculated date? Or have a textbox on your form in which the date is entered (maybe with a selection of possible dates a e.g. current financial year plus two previous years)? Just...
  2. R

    Adding new record

    If you use the navigation buttons at the foot of your form, you can create a new record. If you hover the mouse over the controls on the navigation bar, it will tell you what each one does.
  3. R

    Date Problem in Forms

    Please post the SQL for your query "Get Financial Year" Which date does this refer to? How does it relate to the financial year?
  4. R

    Multiple Instance of Form, problem with Recordsource query

    The volatility of ListBox content is fundamental to the solution to the problem. For now, I shall assume that neither ListBox on the Master form changes its content within the time-frame during which you switch between instances of the Layout form. The solution I propose is that you take a...
  5. R

    Splitting a string

    Sorry :o In the loop For i = 0 To UBound(var) 'Debug.Print i, var(i) Me.txtUsage = var(3) Me.txtSerial = var(0) Me.txtLocation = var(4) Me.txtAlert = var(2) Me.txtBattery = var(5) Me.txtCSQ = var(7) Next I the six statements are...
  6. R

    Splitting a string

    ... and another afterthought I just noticed your code loop transfers every array element in every iteration. If you remove the for loop, you have what you need in the simplest solution.
  7. R

    Splitting a string

    Glad to be of help, even on a Sunday :) I note you already had the 'txt' prefix in hand, so no need for my warning :cool:
  8. R

    Splitting a string

    Sorry, small error in logic. Last few lines of second method should beFor intSplit = 0 To UBound(strSplit) If Not strField(intSplit) = "IGNORE" Then Me.Controls(strField(intSplit)) = strSplit(intSplit) Next(added subscript to end of statement)
  9. R

    Splitting a string

    This should work:Dim strSplit() As String strSplit = Split("9853911264,W-AMR,3,2:320:0:52,MAIN STORE,3.57,0,18,001.004.041,0,0*75", ",") Dim intSplit As Integer For intSplit = 0 To UBound(strSplit) Select Case intSplit Case 0 Me.SerialNbr = strSplit(0) Case 2 Me.Alert =...
  10. R

    Multiple Instance of Form, problem with Recordsource query

    Please post the SQL for your LayoutQuery. In the Query designer, go to SQL view and copy what's there. Are the listbox contents static for the duration of a session (i.e. when the DB is open)? If they are, then perhaps saving the index to the item relevant to each form might be a way to...
  11. R

    Multiple Instance of Form, problem with Recordsource query

    What is the 'Allen Brown' method? Is it relevant here? The quick answer to your question is to use different record sources for each instance of the form. How you achieve that depends upon the relationships between forms, their controls and tables. Perhaps you can save the initial query string...
  12. R

    Splitting a string

    You could try using the VBA Split function to separate the string at some delimiter (such as "," or " "). This gives a string array, the elements of which you can put in fields as needed. If you need more detail, let us know how you would split the string (delimiter) and how the receiving...
  13. R

    Split form combobox requery based on row selected

    Hmmm - tricky one, this :confused: It sounds to me as if the GotFocus event is not firing for some obscure reason, even though the focus must have moved away if you do those other things as you describe. Can you explain (or post) the code from the relevant event of the combobox, so see if...
  14. R

    Interesting Excel Problem (ala Access style recordset)

    I'd use VBA to copy the worksheet you want to your target workbook, if that's what you really need. Here's some code which does that.Private Sub getSheet() Dim b1 As Workbook, b2 As Workbook Dim s1 As Worksheet, s2 As Worksheet Dim varSource As Variant Set b1 = ThisWorkbook Rem retrieve target...
  15. R

    My Crappy Code Needs Fixing

    As Bilbo_Baggins_Esq identified, the StopIfTrue condition was introduced in Excel 2007, which is what you need for your version to work. If I interpret your requirements correctly, you have three distinct conditions: 1. one column contains a number (69472) or a string ("*69472") of interest...
  16. R

    My Crappy Code Needs Fixing

    Is there any reason you are using code to do this? It looks to me as if you could achieve what you want using conditional formatting. If you really do want to use code, try the format rule using the Ribbon, then use the result to determine the format rule you need. If you still need help, please...
  17. R

    Interesting Excel Problem (ala Access style recordset)

    Hi I'm not clear about what you want. Do you want Excel to connect to an Access query, or Access to connect to an Excel worksheet? If it's the latter, you can use DoCmd.Transferspreadsheet action, if it's a one-time transfer (per task). If you want a dynamic link, please provide more details of...
  18. R

    Split form combobox requery based on row selected

    Does the logic of combo box selection have any effect on the current record? If the user has explicitly selected a new record outside of the combo box (e.g. by navigation buttons), then the combo must have lost focus. You could try saving the value of interest from the current record in a...
  19. R

    Form that adds data to a table depending on which option was clicked in combo box

    It's just a simple illustration of the event handling. The code itself is completely irrelevant to the linked tables, in this instance. I take it you mean in the Relationships manager? I very rarely use this nowadays (I did when I first started using Access many years ago, but it's not...
  20. R

    Form that adds data to a table depending on which option was clicked in combo box

    Hi Best illustrated by an example - see attached. The main requirement of linked forms is that they are bound to a table. In my example, there are two very simple tables which are linked by the foreign key (ctParent) in tChild. This FK holds the key to table tParent, which is how the link is...
Back
Top Bottom