Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. TerpFan2001

    Automatically add initials, date & time to a notes field

    I think this is what you are trying to do: Dim sNote as String sNote = Now() & "-" & Environ("username") & ": " IF IsNull(Me.txtAppendField)=TRUE or Me.txtAppendField = "" THEN Msgbox "Please Enter A Note",vbInformation ELSE sNote = sNote & Me.txtAppendField sNote = sNote &...
  2. TerpFan2001

    Getting the result of a query in code

    Try something like this: Dim sSQL as string Dim rs as RecordSet sSQL = "SELECT * FROM [Table] WHERE [Field]=" & YourValue Set rs = CurrentDB.OpenRecordset(sSQL) IF rs.RecordCount>0 THEN MsgBox "Record Already Exists", vbInformation ELSE CurrentDB.Execute YourQuery Msgbox...
  3. TerpFan2001

    a question on SQL

    You can use system stored procedures in SQL Server to get the info you are looking for: sp_HelpDB - lists all databases on the server sp_Help - lists all objects in a database (including tables) sp_Help [table name] - returns info about the table including fields Hope this helps
  4. TerpFan2001

    @BlobEater????

    Thanks, I saw that article. I'm not sure what this thing is supposed to be doing, but it is impacting performance.
  5. TerpFan2001

    @BlobEater????

    We have been performing a performance audit on our SQL Server and the following came back as a high response query: SELECT @BlobEater = CheckIndex(FactKeyA + FactKeyB + Facts) FROM (SELECT TOP 100 PERCENT FactKeyA, FactKeyB, Facts FROM { IRowset 0x18A7F13E } ORDER BY...
  6. TerpFan2001

    Dim varDate As Date ?

    Try something like this: Public g_dDate As Date then g_dDate = format$(Me.txtTransDate, "short date") then Dim m_dDate As Date m_dDate = g_dDate Me.txtTransDate = m_dDate
  7. TerpFan2001

    Newbie: How do insert values from an unbound field into a table?

    If you don't want to add a bound field, you could execute an SQL update. You would need to know the unique ID of the record that you want to update. dim sSQL as String sSQL = "UPDATE [YourTableName] SET [Tax]=" & Me.Tax.Value & " WHERE [YourIDNumber]=" & [IDNumber from...
  8. TerpFan2001

    Saving empty Date data type to table problem

    Sisan: Use a variant data type and set its value based on what has been entered by the user. Dim vDate As Variant If IsDate(Me.txtInputDate) = True Then vDate = Me.txtInputDate Else vDate = Null End If rsTable!InputDate = vDate
  9. TerpFan2001

    sellect one item so that the other options are frozen.

    Bill: Here is an example using two check boxes named chk1 and chk2. When the user updates chk1 the code will either enable or disable chk2 depending on whether the value for chk1 is true or false. Hope this helps. Private Sub chk1_AfterUpdate() If Me.chk1 = vbTrue Then Me.chk2.Enabled...
  10. TerpFan2001

    Multiple Queries?

    Brian: The easiest way to build this in an Access query is to add your table and fields in design view. Then select the Totals button on the query toolbar (looks like a Sigma). This adds a row titled "Total". By default it will be "group by". Change it to "Min&quot...
  11. TerpFan2001

    Do I need DLookup? or.....

    Gus: I think this is what you are looking for. Assuming the check number is always a number. Dim lCheckNumber As Long Dim vPaymentAmount As Variant Dim sLookupString As String If IsNull(Me.txtVoidCheckNo) = False Then lCheckNumber = Me.txtVoidCheckNo sLookupString =...
  12. TerpFan2001

    I am using ActiveX Data Objects to

    FontanaS: I have found that using stored procedures noticeably increases the performance of my VB apps. I think the best way to determine the performance difference would be to write two procedures that perform the same task. One would use your normal ADO recordsets and the other would use...
  13. TerpFan2001

    Stmt works for cbo on subform but not parent form

    Kerry: You won't be able to directly reference the control on the subform from the parent form. Try changing the way you reference the control on the subform from: [Forms]![sfrmRequestDetails]![cboDivision] to: [Forms]![Name of Parent Form]![Name of Subform Control on Parent...
  14. TerpFan2001

    How to store data selected in unbound combo boxes???

    Steve: Why don't you send me the file: If Access 97 - DonnellyFamily@worldnet.att.net If Access XP - pdonnelly@cdrassociates.com
  15. TerpFan2001

    Pop Up Menu for Reports

    Try enclosing the date with # Dim stWhere as String Dim stRptName as String If IsDate(Me.ReportDateBox) = True then stWhere = "[Report_Date]=[COLOR=red]#[COLOR=black]" & Me.ReportDateBox & "[COLOR=red]#[COLOR=black]" stRptName = "Daily Report&quot...
  16. TerpFan2001

    Do Loop not checking all records

    SockMonkey: If you are familiar with SQL you can use an UPDATE statement to do what you are trying to do. Create a procedure and then pass to it the "CompanyCommission" and "StatusNo". Public Procedure UpdateSplits(lStatusNumber as Long, dCompanyCommission as Double) Dim...
  17. TerpFan2001

    Recordset instead of update query?

    Wilson: Just a couple of ideas: 1. After UPDATE you should have the name of the table you want to update. It looks as though you are referencing a query. 2. You also need to change the where clause, it should read WHERE [sale no] = " & [Forms]![Sale]![Sale No] If you are running this...
  18. TerpFan2001

    Field level security?

    OWizard: You could enable/disable certain fields based on the windows user. Use Environ("UserName") to get the current user. Either set up a table of users (if you have a lot of users) or hard code it in the form if you only have a couple of users. Dim sUserName as String...
  19. TerpFan2001

    Recordset instead of update query?

    Wilson: You can also run an UPDATE SQL statement through CurrentDB.Execute. You could place this code in the form close event: Dim sSQL as String sSQL = "UPDATE [YourTableNameHere] SET [Status] = 'Complete' WHERE [StockOrdered] = [StockArrived]" CurrentDB.Execute sSQL If you have...

Part and Inventory Search

Back
Top