 |
| Recent blog posts: | |
 |
| They have birthday today: | |
 |
| Forums: | | |
 |
| Discuss: | |
 |
| Recent forum topics: | |
 |
| Recent forum comments: | |
 |
| Модератор: | |
 |
Sunday, 10 December 2006
|
| Splitting string John 22:27:22 |
| | Hi
Is there a way to split a multi-line address field into individual lines of address in access 97?
Thanks
Regards
|
| | 7 answers | Add comment |
Wednesday, 29 November 2006
|
| Replacing characters John 14:11:11 |
| | Hi
How can I replace characters like carriage return and double quotes from strings?
Thanks
Regards
|
| | 9 answers | Add comment |
Tuesday, 31 October 2006
|
| Finding duplicates Maxi 09:14:32 |
| | I have 100 tabes in an Access database, every table has 1 filed with 100 names (records), no primary key assigned. I would like to find duplicates.
Here is the criteria:
The computer should pick up the first name of Table1 and check that name in that table (Table1) as well as the remaining 99 tables. Continue this till we reach the last name (record) of the 100th table.
Display the result in another table/query. What is the best way to accomplish this task and how to do it.
Maxi
|
| | 16 answers | Add comment |
Saturday, 21 October 2006
|
| Count query dBNovice 01:23:23 |
| | Hey group,
I am trying to do a count of the number of papers in a table. The table has a PaperID that differentiates each paper , e.g. 004.1. Some papers are reused. The reused paper is given a new PaperID. The PaperID includes 3 new numbers appended to the original PaperID, e.g. 664.004.1.
When I do a count, I do not want to count the reused paper. I set up a count query and had the criteria { Not Like "***.***.*" }. I have also tried the criteria { Not Like "###.###.#" } , { Like "***.*" } and { Like "###.#" } but neither gives me the correct count. Please help!!!
|
| | 9 answers | Add comment |
Saturday, 9 September 2006
|
| Select Option Guest 09:07:59 |
| | I have a form (frmSelectIndustry) that I use to determine which filter to apply to a forms recordset. I want to reuse this form for other parts of my application and I am trying to rewrite the code so that it can have more than one use. Currently I store selected items from a list box into a string and then open a form (frmVendorsMenu) with the string as a filter.
The problem with this is that the form (frmSelectIndustry) can only be used to open one form (frmVendorsMenu) but I would like to reuse the form so that it could be used again in the application for example open another form, use a query criteria etc...
Can anyone suggest a way of acheiving this?
TIA
|
| | 4 answer | Add comment |
Thursday, 31 August 2006
|
| Mouse Wheel Loose First Record Jv 20:26:41 |
| | I have quite a few of continuous form and subform where I do allow scroll bars. I run into problems with the mouse wheel whenever the data on the form does not take up the whole page. In this instance, whenever a user uses the mouse wheel to scroll down, the first record disappears off the screen and they can't get it back unless they click on the Refresh button or Page Up. The mouse wheel never scroll back up to the first record. However, this problem does not occur if the data takes up the whole page.
Does any one know how to fix this problem without disabling scroll bars and mouse wheel?
Thanks. Julie Vazquez
|
| | 2 answer | Add comment |
|
| Database Update Vibhu 16:22:03 |
| | Hello all, I am using ADO.NET and trying to update the MsAccess database but unable to do so. Here is the code below that I used.
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim sql As String Connect() sql = "select key, title from tblISBN" ds = New DataSet da = New OleDbDataAdapter(sql, conn) da.Fill(ds, "tblISBN") TextBox1.DataBindings.Add("Text", ds, "tblISBN.title") TextBox2.DataBindings.Add("Text", ds, "tblISBN.key") ds.Tables(0).Constraints.Add("PK", ds.Tables(0).Columns(0), True) End Sub
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click Dim cb As OleDbCommandBuilder cb = New OleDbCommandBuilder(da) Try da.UpdateCommand = cb.GetUpdateCommand da.Update(ds, "tblISBN") Me.BindingContext(ds, "tblISBN").EndCurrentEdit() Catch ex As Exception MsgBox(ex.Message) End Try End Sub
It updates the database but when I check the actual msaccess database file, the data is not updated in that.
Any help will be beneficial.
Thanking You,
Regards,
Vibhu.
|
| | 4 answer | Add comment |
Thursday, 24 August 2006
|
| Clear filters and save doesn't stick. Guest 19:16:42 |
| | I'm trying to defeat persistant filters with the following code in Close, and also in Unload:
Private Sub Form_Close() DoCmd.RunCommand acCmdRemoveFilterSort Me.FilterOn = False Me.OrderByOn = False Me.ServerFilterByForm = False My.OrderBy = "" Me.Filter = "" Me.ServerFilter = "" DoCmd.Save acForm, Me.Name DoCmd.RunCommand acCmdSave End Sub
Somehow the user applied filters stills get saved. I'm not sure what else to do.
|
| | 2 answer | Add comment |
Monday, 14 August 2006
|
| Switching between Access and Excel using code Garry Oxnard 11:50:21 |
| | Can anyone help me to solve a problem which involves switching from Access to Excel (then back to Access) programatically please?
I have an Excel template which, on open, also opens an Access database - containing a list of addresses.
Sequence of events is = (1) Excel template opens in its default XXX.xls filename. (2) Code runs to save the spreadsheet as XXX.xls. (3) User clicks a button to open an Access database containing an address list. (4) When Access opens, a form generates a unique number and the OnOpen event fires the unique reference number to a cell in the XXX.xls spreadsheet. (5) [[[[User has to click Excel on the taskbar to restore the spreadsheet.]]]] (6) A message box with an OK button opens in the spreadsheet and when user clicks the button, code runs to save the spreadsheet using the unique ref as a filename (e.g 3478.xls). (7) [[[[User must then click Access on the taskbar to restore the database. He can then choose an address and click the ok button. This fires the address into the now saved spreadsheet (e.g 3478.xls,]]]]] (8) Access closes and the spreadsheet remains open.
Note - the bits above in square brackets are the bits I can't make work (ie automating the movement back and forth between the applications).
Although this seems convoluted, the only way I can fire data from Access to Excel is by saving the spreadsheet in a default name first - so that Access has a path to which it can then fire the ref number (otherwise it crashes). I need the user to switch to Excel in order to make it active, then re-save the sheet using the ref number as a file name. The user must then go back to Access to choose the address.
Problem is that I can't make the code work to switch the user automatically from Access to Excel, then back again. The rest of the code works ok if I click the applications on the taskbar manually. My users will not know to do this.
I found a posting on Google from Ed Wagner - which sounds as if it will do exactly the job I need (post now closed) but the code is beyond me. I include the block below in the hope that someone can give me a bit of help. I really need to know where to place the code in order to make it work. If it needs to be called - how do I do this please? If bits are missing (e,g End Function) I'd much appreciate it if you could let me know.
Here is the relevant part of Ed's posting (I haven't missed any of his code out - if there are bits missing he missed them out): Many thanks for your possible help.
Garry.
"As far as switching between apps goes, it is necessary to have Windows do this for you via the API. Windows keeps track of open windows by assigning each one a handle. This is a long integer that uniquely identifies the window. The following declaration and statement will obtain the handle for a specific class of window": Private Declare Function FindWindow Lib "USER32" _ Alias "FindWindowA" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long lngHwnd = FindWindow("MSACCESS", vbNullString) 'for finding Access or lngHwnd = FindWindow("XLMAIN", vbNullString) 'for finding Excel "The variable lngHwnd will then be assigned the handle to the window. If the specified window is not found, lngHwnd will be given a value of zero. The following declaration and statement will then set the focus to the specified window: " Private Declare Sub SetFocus Lib "USER32" _ (byval hwnd as long) SetFocus lngHwnd
|
| | 1 answer | Add comment |
|
| Access 97 working slowly...??? Korpisoturi 11:04:36 |
| | Access 97 working little slowly. I have windows 2000. The computer is old..processor is about 300 MHz and RAM- memory capasity is ~164 Mb. Hard disk is 3.0GB.
I have only three tables which are similar. In a table is two fields "date" and "barcode".
I am use MSComm - object, I receive the barcodes from virtual com - ports. When the data incoming to COM port I calling "AddScanRecords". The code is same in everyform.
Access 97 working little slowly. I have windows 2000. The computer is old..processor is about 300 MHz and RAM- memory capasity is ~164 Mb. Hard disk is 3.0GB.
I have only three tables which are similar. In a table is two fields "date" and "barcode".
I am use MSComm - object, I receive the barcodes from virtual com - ports. When the data incoming to COM port the code on below opening...The code is same in every form.
Private Sub MSComm1_OnComm()
Dim buffer As String Dim T1 As Single
buffer = MSComm1.CommEvent T1 = timer
Do Until buffer = 2 If timer - T1 > 2 Then Exit Sub Loop Call AddScanRecords
End Sub
Sub AddScanRecords()
Dim db As Database, rs As DAO.Recordset Dim StartTime As Date
StartTime = Now()
Set db = CurrentDb Set rs = db.OpenRecordset("Table1")
rs.AddNew rs![BarCode] = MSComm1.Input rs![ScanDate] = Now() rs.Update
rs.Close db.Close End Sub
Is the database slow because I don't use asynchronous method to open the database?
How can I open the database using asynchronous method?
Please help me!
|
| | Add comment |
|
| MS Access 2000 VBA Code Shows Totally Incorrect Date from Controls on a Form Easystart 09:38:36 |
| | Hi,
Sorry for my English. English is not my native tougue.
I am working in MS Access 2000 with a SQLServer 2000 Backend database. MS Access 2000 is my GUI front end that has SQLServer linked tables in it. One of my forms has two TEXT BOX controls formated as Short Date. The form is binded to a linked table. The linked tables has about 7 records and one of the control is binded to a table field. These two controls displays the date correctly as 01/07/2006 and 31/07/2006 (I am running Windows XP, my regional setting is set to English Australia, location is set to Australia, language for non-Unicode programs is set to English Australia, and my date format is set to d/MM/YYYY) when the form is running. I have some VBA code behind the form to print out these two dates to a text file. The dates show up as 30/12/2005 and 30/01/2006. I really do not know why these dates are totally different. Here's my VBA code:
Open "C:\Results.txt" For Output Access Write Lock Write As #1 Print #1, "GL run from "; Me.txtFromDate; " to "; Me.txtToDate Print #1, "" :: :: Close #1
I am hoping some one has come across with this problem.
Thanks in advance,
Easystart
|
| | 5 answers | Add comment |
|
| Data grid control Eric 08:31:06 |
| | I create form with master detail relation ship. It shows two data grid control. I want to remove one. I want to use one grid control by which i can add delete data in both tables.
Thanks,
|
| | 1 answer | Add comment |
|
| Code Problem Simon 07:27:40 |
| | Can any one see a problem with this code ( it does not work
Private Sub cmdEmailOrderPlaced_Click() 'On Error GoTo Error_Handler Dim strTo As String Dim strBody As String Dim strSubject As String Dim strItemsOrdered As String Dim CRS1 As ADODB.Recordset Dim strSql As String Set CRS1 = New ADODB.Recordset
sstrSql = "SELECT * FROM tblOrderProduct WHERE OrderNumber =" & Me.OrderNumber
CRS1.Open strSql, CurrentProject.Connection, adOpenKeyset, adLockReadOnly While Not CRS1.EOF
strItemsOrdered = strItemsOrdered & "Item : " & DLookup("[ProductName]", "tblProduct", "[ProductCode] =" & CRS1.Fields("ProductCode"))
strItemsOrdered = strItemsOrdered & "Unit Price : " & Chr(163) & DLookup("[PriceIncVAT ]", "tblProduct", "[ProductID] =" & CRS1.Fields("ProductID")) & vbCrLf
'& vbCrLf & "Total Excl VAT: " & Chr(163) & Format(CRS1.Fields("TotalExVAT"), "##0.00")
If IsNull(CRS1.Fields("Discount")) Or CRS1.Fields("Discount") = 0 Then 'Don't put discount in there if there isn't one Else strItemsOrdered = strItemsOrdered & "Discount : " & CRS1.Fields("Discount") & "%" & vbCrLf End If strItemsOrdered = strItemsOrdered & "Total (Inc VAT): " & Chr(163) & Format(CRS1.Fields("TotalIncVAT"), "##0.00") & vbCrLf & vbCrLf CRS1.MoveNext Wend CRS1.Close Set CRS1 = Nothing
|
| | 8 answers | Add comment |
|
| As a generale rule - Query or VBA? Paul H 07:25:12 |
| | I seem to end up with loads of append and update queries just because it's quick and easy to build queries or make a new ones based on an existing query. But I end up with loads of queries with long names like:
qryfrmCustomers_Diary_DeleteEntriesBeforeADate qryfrmMaintenance_CloneOrder_Step1_CreateOrderIDAndDescription
Am I being lazy? Should I code most of my action queries to tidy up the clutter in the database window?
Is there a general rule for this?
Thanks,
Paul
|
| | 29 answers | Add comment |
|
| OT How much knowledge is enough? Salad 07:20:26 |
| | If one looks at job listings one will read the requirements of for it; .Net, SQL, C#, etc.
How much skill, if years experience in the discipline isn't listed, is needed. Could one simply get the C# program, read a book on it, do a "Hello World" program, and feel comfortable on the topic and apply for the job?
How much knowlecge is enough, if you've got a developer background, on a new language or subject to go for it?
|
| | 37 answers | Add comment |
|
| Maintain Reference to Session-Scope Instance John Mishefske 05:24:50 |
| | I have a "Tracker" class that registers "Messenger" classes to allow distribution of unicast and broadcast messages between instances.
In code a reference to the Tracker class instance is retrieved via code in a module so that anyone can access the Tracker methods. The module code:
Private m_objTracker As clsTracker
Public Function getTracker() As Object
If m_objTracker Is Nothing Then Set m_objTracker = New clsTracker End If
Set getTracker = m_objTracker
End Function
Kind of a Singleton self-healing proc however Tracker maintans multiple references to instances of the Messenger class. An unhandled error will clear the m_objTracker variable and orphan instances of the Messenger class.
Implementing good error handling would prevent the opportunity for variable reset by the user and I believe an .MDE sidesteps this problem but I'm curious if there is a better way to persist a class reference. Perhaps to a table or property?
I could obviously try this myself but was more interested in the experiences and opinions of others as I contemplate the design issue. How are you handling session scoped object references?
I could put this in an ActiveX .dll and use a COM solution but I want to explore a native solution first.
Thoughts?
-- '--------------- 'John Mishefske '---------------
|
| | 4 answer | Add comment |
|
| How to get around too many indexes?? Jeff 02:34:56 |
| | This is the first time that I remember ever having too many indexes on a table, but it has happened.
I have en employees table and store in many places, on tables, the id of the employee that performed some action. Yes, I know, that could be in an audit trail but it isn't. For example, who printed a sales order, who processed it etc is stored on the sales orders table.
Well, I have run out of indexes on the employees table when trying to set up relationships. For now I have take indexes off of things like employee postcode fields as they are not really needed, and have not set some relationships where I am happy that they are not needed - but it bugs me that I have broken my own rule about relationships.
Has anyone else come across this and how have you handled it?
Jeff Pritchard ________________ Asken Research Pty. Ltd. Access Database Developers http://www.asken.com.au
|
| | 14 answers | Add comment |
|
| CAPS for Post Code Julian 02:03:00 |
| | I would like my Post Code field to be autoformated in CAPS when entered in the table. How do I do that? Julian
|
| | 2 answer | Add comment |
Sunday, 13 August 2006
|
| Connecting A Sub Form Cyber0ne 23:37:45 |
| | Probably another easy question...
I have two data tables. One holds the main data, the other holds additional data on a many-to-one relationship with the main data. Using the forms wizard, my goal was to create a form where you enter the main record, then a button brings up the sub-form where you enter as many of the additional info records as needed, all linking back to the main record.
However, the forms don't seem linked in that way. When the sub-form comes up, the record being entered in no way refers back to the record on the main form. So, of course, when I try to enter records into the sub-form I get errors about the referential integrity.
I imagine that one way to solve this would be to, on the button that shows the sub-form, first post the parent form's record and then pass its primary key to the sub-form to use in its foreign key. How would these two steps be accomplished in the code?
Or is there an easier/better way to do this?
-cyber0ne
|
| | 3 answer | Add comment |
|
| Suggestions to resolve slow query David Mitchell 22:38:35 |
| | I need to have a form which will display all products (from tblproducts) and their stock level (sum of product received from tblacqdetail, minus sum of product sold from tblinvdetail) in a listbox. The form should only display those records whose product code contains the characters typed in a text box on the form.
At the moment I do this by using the on change event of the text box and refreshing the listbox.
The queries are a subquery to get stock level and then main query which contains the criteria : - "like *mytextfield*"
This works as it should but takes forever to load and to use, particularly as the on change coding refreshes the list box on each keypress!
Can anyone suggest either a way to speed up the existing method or point me in the right direction of an alternative.
Thanks
|
| | 2 answer | Add comment |
|
| Hard disk or cpu indentification number Alfred 20:00:49 |
| | Hi How can I determine what the hard disk and or cpu's identification (serial no.) is. thanks Alfred
|
| | 1 answer | Add comment |
|
| Subform Eric 19:36:12 |
| | I have three tables in my database. One is main, rest of them i want to use as a sub form in tabular format in main form. I have no experience in creating subforms. Can any one please help me step by step how to i create subform in my main form.
Table Customer (Primary) Table Invoice (Child) Table Voucher (Child)
2nd do i create links between all of these table when i create tables or in the form level.
Thanks in advance.
|
| | 2 answer | Add comment |
|
| How to read data from a PDF file? Martin-G 19:16:27 |
| | Hi.
Now I'm working on a project one of the requirements of which is reading data from a PDF file into a table. I have googled quite a long, but couldn't find any appropriate method to do this. It's unbelievable that there is no COM component for these purpose with automation support which could be easily utilized in VBA. Could anyone help me with this? What would you do?
Thanks in advance
Martin
|
| | 4 answer | Add comment |
|
| SQL Server--when is identity field set? Jan 16:53:56 |
| | Hi:
I'm working on my first SQL Server-backend application and am already running into trouble. This is an application that has run successfully with a Jet backend, and I'm starting out by trying to just use linked SQL Server tables and not changing any of the front-end code.
The problem seems basic. In a table with an autonumber primary key ("TestUnitID") I'm in a module and adding a record. I'll also need to add a record to a related table, so I need to have the primary key field so the records will be linked. My normal procedure is as follows (air code, but you get the idea):
rst is the recordset, strholdval is a variable rst.addnew rst!blah blahset the values of relevant fields strholdval=rst!testunitID'fails here in the new app rst.update
With a Jet backend this works fine. But with the SQL Server backend, it fails because testUnitID has no value. I tried just adding data to the plain table and saw the same thing: an Access table creates a value for the autonumber as soon as the record starts, but SQL Server seems only to create it after the record is saved/updated. But after the rst.update line, I'm no longer on the record and thus I can't find out what the testUnitID is.
THere's a simple answer here, I'm sure, but I can't find it!
Thanks.
Jan
|
| | 13 answers | Add comment |
|
|