Search results

  1. J

    Post Code Validation

    ERROR WARNING Post Code Validation Hi DCrake, The mdb example you have linked to incorrectly accepts invalid postcode formats in the second half of the postcode. e.g. The correct Birmingham code "B15 1TL" is accepted. The invalid format "B15 1TK" is also accepted. The example using the...
  2. J

    Run-time error 432

    For VBA code to validate postcodes without Regex go to: http://www.cleardatasystems.co.uk/postcodeformatvalidator.html This is a more accurate validation than most of the regex codes I have seen and easier to understand! Regards, Julian.
  3. J

    Post Code Validation

    For VBA code to validate postcodes go to: http://www.cleardatasystems.co.uk/postcodeformatvalidator.html This is a more accurate validation than the regex codes and easier to understand! NOTE: TS18 3AM is not a valid code according to royal mail! Regards, Julian.
  4. J

    how to display barcode of a unique number using vba

    Hello Aman, I did this a long time ago. It was not worth the trip. Took far too much time to do as the specifications were tight and the output was a little flakey as Access has not been developed for graphical output. Also you need to know what type of barcode you are using e.g. EAN-128...
  5. J

    a Form_BeforeUpdate(Cancel As Integer) question

    It is called when navigating from a form or record on a form which has new data or the data has changed. I am not aware of determining the calling event. However, this should make the save only occur after the save button is pressed and ignore changes if the save button is not pressed...
  6. J

    Set Visible property of Image in Detail section of Report

    Of the top of my head, try and use the following: Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If isnull(me.Myfield) then me.Myfield.Visible = False ' or use cancel = true to prevent record from being formatted else me.Myfield.Visible = True End If End Sub
  7. J

    Adding 2 time fields together

    =[time 1] + [time 2] works. To get into date & hours format: =(cdbl([time 1]) + cdbl([time 2]))*24 To get into decimal format e.g 9.75 hrs. 1 in a date/time field represents 24 hours. If you expect to have totals beyond 24 hours, I suggest avoiding time formats altogether as either...
  8. J

    reconnect passthrough queries

    I have had problem using passthrough queries as well, but not over the internet. Have you tried: Dim db as database Dim qdf as querydef Set db = currentdb Set qdf = currentdb.querydefs("myquery") qdf.connect = "ODBC;Driver=MyDriver;Persist Security Info=False;UID=User;PWD=password") '...
  9. J

    Change passthrough query connection string

    Using ADODB I can see details of different databases by changing the connection strings. Using Passthrough queries or linked tables I can see details of the different databases by changing their connection strings with SQL Server as the ODBC Server. Using Passthrough queries or linked tables...
  10. J

    Change passthrough query connection string

    Thanks for you help Scooterbug but..... This is all very strange. I tried your suggestion and initially it worked (I had been using a reference to CurrentDb rather than DBEngine.Workspaces(0).Databases(0). :) However, after running other code (using ADODB connections as I wanted to test...
  11. J

    Change passthrough query connection string

    Hi All, I have a passthrough query where I would like to change the connection string using vba: qrydef.Connect = "xxxxx" After changing the connection string, although the query has a new query string, the query returns records from the old query connection string. Only by deleting the...
  12. J

    How to automate renaming field names

    Try, the following, but beware how this interacts with relationships and keys. Sub TableColumnAlter(Table As String, oldName As String, newName As String) Dim counter1 As Long Dim counter2 As Long Dim tbl As TableDef Dim fld As Field Debug.Print CurrentDb.TableDefs.Count For Each tbl In...
  13. J

    rs.MoveNext increasing recordcount

    Just remove dbOpenDynaset. That works as it opens a table-type recordset rather than a dynaset (which only populates the full recordset once navigated to the end).
  14. J

    Store by region or country, search by postcode

    The problem is similar to a bill of materials, in that you have a hierarchical structure of data with postcode being a child and town being a parent. The town itself will have a parent (the county), the county has a parent (region e.g. Scotland) the region has a parent (Country e.g. UK). This...
  15. J

    rs.FindFirst help, re dates & time values

    Why not try something like this: If DCount("Anyfield", "Mytable", "[Datefield]=" & Dates.DateOfBooking & " and [TimeField]=" & Dates.TimeOfBooking) > 0 Then DoCmd.GoToRecord , , acNewRec End If
  16. J

    Importing text file

    In VBA Tools>references, add the reference for file dialogs which is in "Microsoft Office XX.X Object Library" Then try: Private Sub Command0_Click() Dim fd As FileDialog Dim fileString As String Set fd = Application.FileDialog(msoFileDialogFilePicker) fd.Filters.Add "Text Files (*.txt)"...
  17. J

    Set Visible property of Image in Detail section of Report

    Set the Report's Default View to Print Preview, otherwise the format event does not appear to fire.
  18. J

    Question Help with relationships

    Simplest way is to write an append query that will append data from the purchase requisition table where PO number is [PO number] on the receiving form. Create a button on your receiving form that runs the above query by macro.
  19. J

    populating list boxes VBA

    It may be simpler to refer to the relevant comboboxes in the query builder. Then the afterupdate code is simply Combo16.Requery e.g. Private Sub Combo16_AfterUpdate() Combo14.Requery End Sub
  20. J

    Creating 2 user accounts in accdb database

    I believe access 2007 has no user level security. I suggest split the database with a frontend as an AccDE and back end password protected. The front end cannot be designed, so keep the designable version elsewhere so you can edit it then overwrite the AccDE when needed. The data remains...
Top Bottom