Search results

  1. C

    how to bring value of query to table?

    Hi, You can no doubt create an Append Query to do this but my preference is to build the query string in VBA code and tie it into the OnClick event. That way you can add any code to check values prior to inserting into your new table. Dim strSQL As String 'build the string...
  2. C

    Cron job issue with multiple instances

    You have a number of options, including created you own launcher database or VB executable to test that the file is not already in use. Perhaps the easiest option might be to create a batch file, which checks that the Access lock file (*.ldb") does not exist before opening it again. You could...
  3. C

    how to bring value of query to table?

    Firstly, have a look at the information on how to refer to subforms, check out this recent post http://www.access-programmers.co.uk/forums/showthread.php?t=163782 From your post it is not clear where the value for the field on the main form is coming from. I see two possible options. Option...
  4. C

    Concatenate string to Field Names

    Hi Jason, Glad I could help. I initially tried the CurrentDB option and got the error you mentioned, which I later realised was because CurrentDB creates another instance of the currently open database. I expect that most changes to the schema would therefore need to use the DBEngine option to...
  5. C

    Concatenate string to Field Names

    Use the TableDef and Field Objects; Public Function EditTable() Dim dbs As Database Dim tbl As TableDef Dim fld As Field 'set a connection to your database - which could be as simple as the 'name of the local db, or you might be using a connection string Set dbs =...
  6. C

    Refresh combo

    Did you put a breakpoint in your VBA code to see if the AfterUpdate event is firing? I have just set up a couple of forms to test this and used the syntax previously posted and the combo in the subform is getting the udpated values on AfterUpdate. The only difference between AfterUpdate and...
  7. C

    how to query

    You can use the same query, but add the WHERE clause to show only A or B values. SELECT IIf([CONDITION]="A",[ID],[FIRST NAME]) AS FIELD1, IIf([CONDITION]="A",[EMP],[LAST NAME]) AS FIELD2, PROFIT.CONDITION FROM PROFIT WHERE PROFIT.CONDITION=[Enter the Condition]
  8. C

    Combining multiple rows into one row in SQL

    You get this error if the query you are trying to send to the function includes parameters that come from a form, such as WHERE [Field1] = Forms!MyForm.txtField1. Does your query PAAF_CoAp2 get any values from forms?
  9. C

    Closing Document Removing Icon

    What version of Word are you using? Does OpenWord have a Quit method? You definately need to close/quit the current Word.Application instance to get rid of the icon.
  10. C

    how to query

    SELECT IIF([CONDITION]="A",[ID],[FIRST NAME]) AS FIELD1, IIF([CONDITION]="A",[EMP],[LAST NAME]) AS FIELD2 FROM PROFIT On caveat on this solution is that you will always need to output the same number of fields for both A and B and you should use an Alias for the output so that you can refer to...
  11. C

    Question Run-time error '2501': The OpenForm action was cancelled

    It may also be some kind of issue with references. Missing references tend to throw up strange errors. The reference issue could arise if that user had installed some software on the problem PC, which over-writes some of the required DLL's. References do not usually stop you opening the...
  12. C

    REWARD-Is this even possible? Auto-Schedule

    PS. Best of luck for the Job.
  13. C

    REWARD-Is this even possible? Auto-Schedule

    Here's one possible solution - create a table linking Branches and the years in which they have a full audit. End users would set their current Branch location during login. Then you only require two queries, the first "qryAuditYear", returns branches being audited in the current year. The...
  14. C

    Combining multiple rows into one row in SQL

    As suggested, you are going to have to create a function that uses a Recordset to loop through the results of the query and joins (concatenates) them together. For example: Public Function Concatenate(strQueryName As String, strDelim As String) As String Dim rst As DAO.Recordset...
  15. C

    Automation - hide backend table

    According to Microsoft, Access will always open automatically and you would need to use the Windows API to hide it as discussed in the link. http://support.microsoft.com/kb/167659
  16. C

    Closing Document Removing Icon

    In your code "OpenWord" is an object representing an New instance of Word. You are currently opening Word then performing your operation, but you are not closing Word, which is why the icon continues to be displayed in task manager. You need to add: OpenWord.Close [depending on your version...
  17. C

    Refresh combo

    Without a little more code, I am not sure what is going wrong, as I have used similar logic in a number of databases. You mention that you used the I would normally use the Form_Close event, but you should insert a breakpoint to make sure afterupdate is firing when you expect. Another...
  18. C

    Closing Document Removing Icon

    I expect you are not quiting the instance of Word that is opened by you code, although it is not clear from your post that you are using Word to read or write the files. This code snippet may help; Set myWordApp = CreateObject("Word.Application") ...process your files myWordApp.Quit
  19. C

    Help with a Search Function

    To get the one field to perform your search on concatenate the first and last names in the underlying query. For example FULLNAME: FNAME & " " & LNAME Then you can use something like: rs.FindFirst [FULLNAME] Like "*" & Me.txtSearchField & "*"
  20. C

    Question Run-time error '2501': The OpenForm action was cancelled

    First thing I'd do is check the permissions on the folder where the database is located for the users that are having the issue and make sure they have read write permissions.
Back
Top Bottom