Recent content by Christos99

  1. C

    calculate field based on second column of selection

    Use & to concatenate 2 strings. =Now() & [Txt_Category].[column](1) Try looking up help on Weekday function
  2. C

    calculate field based on second column of selection

    Have a text box on the form. Set it's control Source property to =Combo0.column(1) where combo0 is your combo box name. This will update on the form when you change the combo box selection.
  3. C

    calculate field based on second column of selection

    You can refer to the currently selected values in the combo box using the column property. So cboname.column(0) is the first and cboname.column(1) is the second. Is that what you are asking ?
  4. C

    Excel to Access VBA transalation

    Looks like a 3rd 'duplicate' from http://www.access-programmers.co.uk/forums/showthread.php?t=271135 You have also PMd me. Might be a good idea to keep all in one place, rather than take the scatter gun approach !
  5. C

    Best form event to update stock

    Hi, I would update the stock in the after update event of the order line form as you don't want someone else grabbing the stock (if it is multi user). Just bear in mind you may have to reverse the stock allocation if the order is not completed or cancelled.
  6. C

    Easy one: Running this macro for excel, in access -How?

    Hi, I have seen this code in an Access DB I worked on recently. It runs an Excel Macro from an external file (.bas) Dim wb As Variant Set wb = xApp.Workbooks.Add Dim vbC As VBComponent Set vbC = wb.VBProject.VBComponents.Import("C:\Test\ReportSetup.bas") wb.Application.Run...
  7. C

    Query Criteria from list box

    Hi, i tried building a hidden text box containing the listbox selected items, then using IN from the query e.g In [Forms]![form1]![txtSelected] However it doesn't recognise this and wants a real IN clause. So your alternative is to build the query string when you need it, based on the list...
  8. C

    Check box validation

    I would by default make the Paid checkbox 'enabled = false' then in the AfterUpdate event for dispatched (if checked), set the Paid checkbox 'enabled = true'. You may need to do it in the Current event for the form too, in case returning to a record where dispatched is checked.
  9. C

    How to count number of rows in a table?

    Glad it worked for you. Coding this was the most fun I have had this week! Try the following. Lookup help for INSTR so you can see how it works although fairly obvious. If InStr(1, !field1, "apple") > 0 Then
  10. C

    How to count number of rows in a table?

    Hi try this : Call Del_Invalid ("Apple") Cheers, Chris Option Compare Database Option Explicit Sub Del_Invalid(strSearch As String) Dim db As Database, rst As Recordset, lngcnt As Long, k As Long On Error GoTo Del_Invalid_Err Set db = CurrentDb Set rst =...
  11. C

    Question Database Security / User Permissions?

    Hi, You should be looking at a front end / back end split at least if you stay with Access for the data as opposed to SQL Server. The front end should be released to the users as an executable (accde) which will prevent them changing the design. There are other ways to further protect the accde...
  12. C

    selecting fields

    Access isn't going to understand what you are doing here. You want Office to be a string variable if you are including it as text in your sendobject command. If you know the office in advance of calling cmd_mailreport you could pass as a parameter like cmd_mailreport_Click(strOffice as string)...
  13. C

    Question Beginners question

    Hi, No need for a seperate field for age. As it may change, it should be calculated whenever required for display. Try searching the web for 'vba Calculate a persons age given the DOB' Plenty on there. You can use a custom VBA function from the report field to calc this. Chris
  14. C

    Access 2010

    I think your issue is that all the code windows are shown overlapping. Maximise the one you want and that will be the only visible one.
  15. C

    Dao connection string to sql server through vba

    Try this: Dim db As Database (declare at module level so available in all procedures) The main code AttachAll (I have all of this in a form with a button to attach all tables) opens a recordset to read each record from your ‘TablesToAttach’ table containing the table in field TableName...
Top Bottom