Search results

  1. C

    converting excel equation into access equation

    did you try IIF? Syntax IIF(expression, truepart, falsepart). These can be nested too just like your Excel equation. Example IIF(expression, IIF(expression, truepart, falsepart),falsepart)
  2. C

    How to count just 'Yes' in a field

    Add an IIF() statement to query and set the value to 1 if the field contains Yes. Then you can sum the field to get the number of yes'. In the example below tblYes contains a field Question1, which is of Yes/No datatype. SELECT Count(tblYes.ID) AS CountOfID, Sum(IIf([Question1]=-1,1,0)) AS...
  3. C

    Auto Pop text in box, from combobox click

    One popular way is to add the fields you want into the RowSource query of the combobox. For example, your query might be "SELECT ID, cName, cAdd1, cAdd2 FROM tblCustomers" Set the ColumnCount=4 (match the number of columns in your query) Set the ColumnWidth=0;4;0;0; (set to zero for those...
  4. C

    Help with Import a Table Data

    Are the two tables in the same database? If so, simply create a new query, set the query type to Append and choose your new table. Then you simply select the fields from your original Employee table and since they are named the same you should find that Access will automatically do the field...
  5. C

    Get rid of duplication

    Hi Mithani, Sorry, I assumed you had used a grouping with footer to the report (grouping on POAmount). If you had, then each purchase order would have its own totals line.
  6. C

    Get rid of duplication

    That's what you would expect if you are summing the column. You need to remove the sum of POamount in your group footer to display just the actual amount.
  7. C

    Regular Reporting Dilemma

    How do you determine when the reports are due now? A little more information might be helpful. You can easily set a due date for reports, which makes it easy to determine if they are overdue. From your comments I suspect however that the reports may be recurring, such as being required on a...
  8. C

    Update the Foreign Key

    If all you want to do is report on the products that do not have a record yet in the dispatch table, you would be better served to use a query, unless you really do want to add every Product as it is created.. The query uses two tables: tblProducts and tblProductDispatch - where ProductID is...
  9. C

    value of list to text box

    There are good examples of using the listbox control in the Access help - search for ItemsSelected. The following code loops through the listbox and prints the selected items, which can be used for multi-select and single-select listboxes. You could easily replace the Debug.Print with code to...
  10. C

    Using sql output in VBA

    Tim, I am glad jal was able to help you out. For future reference I have attached a very simple example of 2 linked comboboxes, where the second box filters records based on the value of the first. The key to the whole issue is basically to set your AfterUpdate event for the first combo, to...
  11. C

    SQL & Combo Box

    Yes, as ACMAIN suggested, use cmb.BoundColumn = 1 with your current rowsource to link VAL as the value of the combobox instead of TXT.
  12. C

    Annual Database Updates

    As I assume you will want to keep the previous history so you should add all the new players into the database, but not replace the existing players. You can then have a flag 'Active' or a 'Year' field that you can use to determine the current players. The year option may be useful as you...
  13. C

    Question parameter value

    You can use the query builder to add the combo and textboxes to the criteria of your query. Simply right mouse click over the Criteria field in the query window and select Build. You would end with a SQL statement along the lines of SELECT TableOne.Field1, TableOne.Field2, TableOne.Field3...
  14. C

    SQL & Combo Box

    What happens when you use the code you have posted? Do you still get the error about the data being used by another user? One quick thing, your query only has 2 fields, yet your BoundColumn is set to use column 3? It is unusual that a select query would lock the table, so I would check that...
  15. C

    Before_Update with Command Close button on Subform

    Just a thought, but woudn't you expect the form to close if the user presses the close button? The cancel=True call in the Before_Update event relates only to the updating of the current record, it has no magical 'Stop all previous commands' functionality. You would have to validate your form...
  16. C

    Conditional Formatting like in Excel

    Is the Warranty field a text, checkbox or combobox control? As this will change how to access the value and events. If [Warranty] is a checkbox or combobox on your form, you can use the After_Update event to test the condition you want. I have prefixed the fields with the control type I...
  17. C

    Minimum and Grouping

    I am not sure if there is a better way but try this. I have called the table tblCode - replace this with whatever your table is called. Build a query with just the Pcode and MIN grouped by PCode. SELECT tblPcode.PCode, Min(tblPcode.Status) AS MinOfStatus FROM tblPcode GROUP BY tblPcode.PCode...
  18. C

    Using sql output in VBA

    Hi Tim, I do a similar thing all the rime, where users select a customer, based on a number of search fields (such as customer name). They can then open a form for a selected customer, which contains a number of 'sites' where the customer is operating from. I use a subform to list the...
  19. C

    shrink and expand subform

    If you are using the Datasheet view for you subform, you could control the widths of each column using ColumnWidth in you VBA code for Form_Current. Me.[subformname].Form![ControlOnSubform].ColumnWidth = X You could work out what X is based on the width of your subform control on the...
  20. C

    Outputting XML into Html

    The problem is that you are using client side scripting so your source code will always have the JavaScript code showing, not the actual data. You should use server side controls/code, such as ASP.NET, which will process the XML and return valid HTML, which is rendered in the browser and gives...
Back
Top Bottom