ms-access-2007

Why does MS Access 2007 not allow a row insert, but then allow it on the next insert attempt?

放肆的年华 提交于 2019-12-06 22:44:49
问题 My insert statement is: INSERT INTO myTable (inst_id,user_id,app_id,type,accessed_on) VALUES (3264,2580,'MyApp','Renew',Now); ...where all of the values are formatted correctly. The table has the above fields and one other, a long int auto-increment key field. The foreign keys are 'inst_id', 'user_id', and 'app_id'. I am getting this error from Access: ...and the following error from VS 2005 when it errors out: System.Data.OleDb.OleDbException: The changes you requested to the table were not

Set a selection of text to bold inside a RichTextBox

大憨熊 提交于 2019-12-06 21:57:34
In an MS-Access RichTextBox on a Report, I want to make a selection of the text bold. I found this post on a forum which explains how to do this in VB6. I tried the same in MS-Access, both with a normal Access textbox with the Text Format property set to Rich Text and a Microsoft Forms 2.0 TextBox added via the ActiveX Controls dialogue box, neither works. I know VBA is based heavily on VB6 so my logic is if it can be done in VB6, I should be able to do it in Access. Am I right? Is it possible to set a selection of text to bold inside a RichTextBox on MS-Access? You do not mention the version

Update Query from a Lookup Query

帅比萌擦擦* 提交于 2019-12-06 20:59:27
I have a spreadsheet that I am converting to an Access DB. I have a column of typed out customer names that I want to replace with the appropriate customer number from our accounting system. I have created a table with the customer info, and a query that shows what ID needs to be inserted into the source data. What I'm looking for is: UPDATE tblStarting_Data SET CustomerID=x WHERE TEMPCustomer=y Where X and Y come from qryIDPerCustomer. Can I use a loop? How do I reference another query? Another possibility in MS Access (object names borrowed from Tomalak answer): UPDATE tblStarting_Data,

Selecting Time ranges from Date Time fields in Access

可紊 提交于 2019-12-06 19:21:38
I have a table containing reports and the date/time they were created. I'd like to create a graph to tally the number of reports created during intervals of ten minutes between two time periods: 8:00AM-9:00AM and 1:00PM-2:00PM. Here's an example of a query I'd like to run: SELECT s.StudyStartDateTime AS "8:00 - 8:10", s.StudyStartDateTime AS "8:10 - 8:20", s.StudyStartDateTime AS "8:20 - 8:30", s.StudyStartDateTime AS "8:30 - 8:40", s.StudyStartDateTime AS "8:40 - 8:50", s.StudyStartDateTime AS "8:50 - 9:00", s.StudyStartDateTime AS "1:00 - 1:10", s.StudyStartDateTime AS "1:10 - 1:20", s

How can I sort by date in ms access 2007?

隐身守侯 提交于 2019-12-06 17:45:30
Just want to know how do I sort a text column that shows data in date format mm/dd/yyyy. You will first have to convert to a date to get a proper sort. This is a query that converts Datetext to RealDate, and then sorts on that column (field). You can also click the header to choose the sort order. SELECT t.ID, t.Datetext, DateSerial(Mid([Datetext],InStrRev([Datetext],"/")+1), Mid([Datetext],1,InStr([Datetext],"/")-1), Mid([Datetext],InStr([Datetext],"/")+1, (InStrRev(Datetext,"/")-InStr([Datetext],"/"))-1)) AS RealDate FROM Table t Order By 3 You can use IIf to avoid errors from null: IIf(

Retrieve previous row to subtract from current row by date

点点圈 提交于 2019-12-06 16:36:20
I have a table with only 2 fields: NAV_Date and NetAssetValue . NAV_Date is the last day of a quarter. +----------+--------------+ |NAV_Date |NetAssetValue | +----------+--------------+ |12/31/2012| $4,000| +----------+--------------+ |03/31/2013| $5,000| +----------+--------------+ I am attempting to write a query that subtracts the more recent from the previous. Currently, my query simply selects all values within the table. I know to perform this I would have to retrieve the prior record each time through, however I'm not sure how to do that. Ultimately I will use (( CurrentValue /

Access VBA to split out ALL merged cell in Excel

别来无恙 提交于 2019-12-06 16:01:23
I need to import some Excel files into Access database. I know how to write the import function in VBA but it is not working as I expected since some merged cell in Excel cause me trouble. So for example, in the Excel spreadsheet When importing to Access table, it imported row by row . So the 1st row should be 1-pencil-90, and it is correct but the 2nd and 3rd row is empty due to the merged cell. The result is No|Product|Storage 1 | pencil|90 | |23 | |41 But expected result should be: No|Product|Storage 1 | pencil|90 1 | pencil|23 1 | pencil|41 I want the VBA to split the merged cells and also

Access database sharing strategies

淺唱寂寞╮ 提交于 2019-12-06 15:34:21
问题 What are the strategies you employ to let multiple people work on an access database? Is it possible to host it online and have its features still functional without having to develop a custom frontend? MS Access as a software has a few nice features that don't require any programming to configure: Drop down lists - choose one Multi Checkbox lists - choose multiple Is it possible to get all of these features available even when hosted online? I'm basically thinking of an alternate way to

Automate build of Access 2007 database

我只是一个虾纸丫 提交于 2019-12-06 14:34:17
As part of our build process we have to create an Access ACCDB (2007) database. The database constitutes the current front-end of our application and must be (for other reasons) build during the initial phase of the build process. Currently, this is a manual process which I'm hoping to automate. Our database consists of MANY tables, formulas, queries, etc. I believe we're actually close to the limit of what Access is actually able to handle so we try not to add anything further to it. I've had a look at this project: http://buildmsaccessdb.codeplex.com/ and it seems to work pretty well.

Duplicate each row pulled in and add an extra field counting up one day between a given start and end date

回眸只為那壹抹淺笑 提交于 2019-12-06 13:42:40
I'm using Microsoft Access and I want to create a query that duplicates each row pulled in from a table with an extra field added on counting up one day between a given start and end date. So if there's 4 days between the start and end date there's 4 duplicate rows returned for each record with only difference being the added date field counting up 1 day. Is this actually possible to do? HansUp This task is fairly easy if you have a calendar table which includes a row for each date you need. (See this Stack Overflow answer for other reasons why a calendar table can be useful.) Without such a