Search results

  1. Nouba

    Table Field properties in ADOX

    I think, there is no way to set the Caption property of a field with ADOX. Use instead good old DAO. Sub SetFieldCaption( _ Tablename As String, _ Fieldname As String, _ Caption As String) Dim fd As DAO.Field On...
  2. Nouba

    Update query depending on parameter

    This could be done by an Update Query in which you can set the Parameter to your control on the form.UPDATE YourTable SET YourPriceField = YourPriceField + [Forms]![YourFormName]![YourControlName]
  3. Nouba

    Two simple questions

    You have repeating groups in your table which violates the rules of data normalisation. What will you do if you have a case with 3 or more judges? In the sample you can use a Union Query for getting all the judges in the combo box. SELECT Judge FROM Cases UNION SELECT Judge2 FROM cases
  4. Nouba

    Dynamic query for Report

    try opening a report which has to been set with qryFindCalls as the RecordSource.CurrentDb.QueryDefs("qryFindCalls").SQL = strSQL DoCmd.OpenForm "YourFormName", acViewPreview
  5. Nouba

    Go to Random record

    try thisDoCmd.GoToRecord , , acGoTo, Int(Rnd() * Me.RecordsetClone.RecordCount) + 1
  6. Nouba

    Change Pic on New Record

    you can put your code in the form's Current event. If Me.NewRecord Then ' here comes your code End If
  7. Nouba

    Very Tricky Crosstab Query Question

    If your field numbers is already calculated you could try the following querySELECT [date] , articles , numbers + ((SELECT Count(*) FROM YourTable WHERE articles=T.articles AND [date]<T.[date])+1)*2 AS IncreasedNumbers FROM YourTable AS T ORDER BY articles , [date]
  8. Nouba

    Very Tricky Crosstab Query Question

    Prepare the query that you are using in the cross with the appropriate calculations. I. e. SELECT [date] , articles , numbers , (SELECT Sum(numbers) FROM YourTable WHERE articles=T.articles AND [date]<=T.[date])+ ((SELECT Count(*) FROM YourTable WHERE...
  9. Nouba

    Textbox AllForm

    You could use a public function like this for getting all the forms in the database forms container. Public Function GetAllForms() As String Dim objDoc As Variant Dim strAllForms As String For Each objDoc In DBEngine(0)(0).Containers("Forms").Documents strAllForms = strAllForms &...
  10. Nouba

    Append Query With Different Field Names

    you could try this Append Query. I would think about whether it is meaningful to duplicate the complete data. INSERT INTO P_Table ( Pnum, Pname, Pcity ) SELECT IP.IPnum , IP.IPname , IP.IPcity FROM (SELECT IP.IPnum , IP.IPname , IP.IPcity FROM IP_Table AS IP INNER JOIN...
  11. Nouba

    How to write query that can recursively check values in a column

    Thanks KKilfoil for your statement. My comment was wrong.
  12. Nouba

    How to write query that can recursively check values in a column

    Here is a sample for what KKilfoil was saying.
  13. Nouba

    Expression in Query

    Change Mile-O-Phile's query to something like SELECT fdate , (Sum(acd_calls) + Sum(abn_calls)) / (SELECT Sum(acd_calls) + Sum(abn_calls) FROM tblstats WHERE Weekday(fdate)=2 AND Month(fdate)=3) AS PercentageOfCalls FROM tblstats WHERE Weekday(fdate)=2 AND...
  14. Nouba

    Combo Box Query

    After you've set up your form with the necessary controls for each field, put an unbound combo box in the header or footer of your form. The combo box wizard will give you an option for finding records and guide you through the creation process of this control. The query in the Row Source of...
  15. Nouba

    show tool bar

    yes, this should be possible. I.e. with a toggle button.Private Sub tglShowMenu_AfterUpdate() Me.ShortcutMenu = Me!tglShowMenu End Sub
  16. Nouba

    SELECT and INSERT query

    You must not set a value for an AutoNumber field. Try the following code and adjust the field names in the code to the appropriate names of your table. Dim strSQL As String strSQL = vbNullString ' assuming all 3 fields are of type text strSQL = strSQL & "INSERT INTO Table1" & vbCrLf...
  17. Nouba

    Loop Through SubForm Controls

    one possibility is calling a custom procedure twice. i. e. CheckTextBoxCtl Forms!frmSupplyRequestDetail CheckTextBoxCtl Forms!frmSupplyRequestDetail!sfrmCtrlName.Form Private Sub CheckTextBoxes(oForm As Form) Dim ctl As Variant For Each ctl In oForm If ctl.ControlType =...
  18. Nouba

    maximum values

    here is a sample of the above query.
  19. Nouba

    maximum values

    you can achieve this by using a query which restricts the values by defining two subqueries used in the where clause with the appropriate order direction.SELECT T1.aGroup , T1.aValue AS TopBtmVal FROM aTable AS T1 WHERE T1.aValue In (Select TOP 3 aValue From aTable Where...
  20. Nouba

    How do I set an unbound forms filter on open

    If the RowSource is set up correctly you can use in the OnOpen or OnLoad Event of the form something likeMe!YourCombo = Me!YourCombo.ItemData(0) This will select the first item in a List/Combobox. After that you have manually call the AfterUpdate Event procedure because the event isn't triggered...
Back
Top Bottom