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. chris153

    Autonumber Multiple sequential values

    Hi, You could try a function such as : Function Contact_ID () Dim idfield As Variant idfield = DMax("[ID]", "TableName", "[ID] Like '11*'") If IsNull(idfield) = True Then Contact_ID = 110001 Else Contact_ID = idfield + 1 End If End Function Hope this helps !
  2. chris153

    Programatically copying a table between two databases

    Hi, Try this code in MyDB1: DoCmd.TransferDatabase acExport, "Microsoft Access", "C:\MyDB2.mdb", acTable, "MyTable", "MyTable"
  3. chris153

    Autonumber a column in a query based on another column?

    Hi, If you're using a form to enter the contacts you could try using an AfterUpdate event the Customer field, such as : Private Sub Customer_AfterUpdate() Dim idfield As Variant idfield = DMax("[Contact_ID]", "TableName", "[Customer] = '" & [Customer] & "'") If IsNull(idfield) = True Then...
  4. chris153

    Test Table for 0 Records

    Hi, You can use ADO : Set rs = New ADODB.Recordset rs.Open "Table_Name", CurrentProject.Connection, adOpenKeyset, adLockOptimistic MsgBox (rs.RecordCount) rs.close Make sure you've referenced the ADO Library
  5. chris153

    Error coding around Runtime Error 3011

    Hi, Try using the Dir function to check if the txt file exists instead of waiting for the error Check_FilePath = Dir(file_path) Check_FilePath = True if it exists Otherwise you can check for the error number in your error handler as follows if err.number = 3031 'Resume else...
  6. chris153

    identifying a field in a recordset consisting of 2 tables

    Hi, You need to link the two tables in the sql statement. Try building it as a query and copying the sql, it'll look something like this : SELECT t_orders.order_status, t_orders.Contact_name FROM t_customer INNER JOIN t_orders ON t_customer.customer_ID = t_orders.Customer_ID WHERE...
  7. chris153

    Check for Dirty and undo in Bound Form

    Sorry I'd assumed you were using unbound forms. Kens answer should do the job for you
  8. chris153

    Check for Dirty and undo in Bound Form

    Sean, I had the same problem. Its messy but I declared a Private Boolean within the module of the form and set it to false when the forms opened. Then on the AterUpdate event of each of the controls on the form I added code to change the Boolean to true. I then used the OnCurrent event of...
  9. chris153

    Borders on reports

    This is the complete code that I used, try copying it directly into your event procedure. Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) Me.ScaleMode = 1 Me.DrawWidth = 3 Me.Line (0, 0)-(15518, 0) Me.Line (0, 0)-(0, 14400) Me.Line (629, 0)-(629, 14400) Me.Line (3975...
  10. chris153

    Borders on reports

    Hello, Try typing these lines before the code : Me.ScaleMode = 1 Me.DrawWidth = 3 Sorry, I forgot that you had to define the measurements that the lines are measured in.
  11. chris153

    Reset Autonumber - a quicker way ?

    MakeItSo??? It should work if you haven't installed Microsoft Jet 4.0 Service Pack 4 (Msjet40.dll version 4.00.2927.4) or later. Have a look at this link which shows a work around if you have a later service pack. http://support.microsoft.com/default.aspx?scid=kb;en-us;287756&Product=acc...
  12. chris153

    Reset Autonumber - a quicker way ?

    Hi, If you compact the database all autonumber fields are reset within each of the tables.
  13. chris153

    Need help with Filters in a Report

    Hello, When you build a query and add a criteria e.g. [Please enter the id], you can define it as a parameter so that Access knows what type of data type it should be. In the Menu Bar of the query builder goto Query, Parameters... and type in the parameter that you want to define and choose...
  14. chris153

    Making changes on Front End Design

    Hello, 1. Try setting up a batch file, which copies the secured front-end from a network drive onto the users PC, e.g. xcopy {location and name of front-end} c:\ /e copy this into notepad and change the file extension to .bat, double click on the file to run it. 2. I'm afraid so, you could...
  15. chris153

    parse a field

    Its abit nasty but effective (like herpies cream!) Function Hello(Chris100 As String) As String Hello = Mid(Chris100, InStr(1, Chris100, "(C", vbTextCompare) + 1, InStr(1, Chris100, ")", vbTextCompare) - InStr(1, Chris100, "(C", vbTextCompare) - 1) End Function You have to reference the...
  16. chris153

    Starting new record after calling another form

    Hi, Just try putting this line of code in after you close the form : DoCmd.GoToRecord acDataForm, "FormName", acNewRec That should do the job !
  17. chris153

    What is wrong with this code

    No probs, Make sure that the 'Microsoft DAO 3.6 Object Library' reference is checked. If it is I'm in trouble
  18. chris153

    Dmax criteria problems with date changes

    Are the startdate and dateinput fields in different tables? If so link the tables in a query and add the price to the query results.
  19. chris153

    parse a field

    Hi, Does it always start with C and is there ever a C elsewhere in the description Also, is the (C0102292) always the same length and at the end of the description ? PS, nice name !!!
  20. chris153

    What is wrong with this code

    Looks OK ! try using DAO (Should be quicker than 2 DLookups anyway!) dim db as dao.database dim rst as dao.recordset set db = CurrentDb() set rst = db.openrecordset ("SELECT * FROM tblZips WHERE ThreeDigZip = '" & Me.ThreeDigZip & "'", dbOpenDynaset) rst.movefirst me.city =...

Part and Inventory Search

Back
Top