Quantcast
Channel: Access for Developers forum
Viewing all 14673 articles
Browse latest View live

dbfailonerror:128 : Insert Command for Multiple textboxes

$
0
0

Dear All,

        I am beginner for  MS Access  2013 vba programming .I had a MS Access form with multiple text-boxes and I tried to insert multiple text-box values into Access table.

     I tried to insert in two ways , 1 getting all the text-box values into variables and executing the command .Other using text-boxes directly into insert command .But I am getting failure in both the ways and facing error 128.

Can any one help me how can I achieve this with my below code.

Code :           

Dim intResponse, tempmobilenumber As Integer
Dim strMsg As String
Dim strSQL As String
Dim tempname, tempaddress, tempemailaddress As String

 strMsg = "You are about to Save Customer Information?"
            intResponse = MsgBox(strMsg, vbExclamation + vbYesNo, "Save Information?")

  If (intResponse = vbYes) Then
   tempname = Me.txtname.Value
   tempaddress = Me.txtaddress.Value

 strSQL = "INSERT INTO CustomerInfo(Name,Address,Mobilenumber,EmailAddress) VALUES (' " & Me.txtname.Value & " ' , ' " & Me.txtaddress.Value & " ' , ' " & Me.txtmobilenumber.Value & " ' , '" & Me.txtaddress.Value & " ' );"
CurrentDb.Execute strSQL, dbFailOnError + dbSeeChanges
strMsg = "Rupees ' " & Me.txtname & " ' Saved Successfully"
MsgBox strMsg, vbInformation, "Save Complete"



Thanks, Quality Communication Provides Quality Work.

Sid



version control for access

$
0
0

I've been using this access program for about 15 years but we haven't had the need for any changes in a long time. Recently I started using git on our website development and live site. And now that I'm needing to hire out some changes for our access program I'm realizing that there literally seems to be no way to version control access. After getting used to some very basic git commands, dealing with changes to access is rather cumbersome because you just have to copy changes over from test to live. Or at least, that's how I've been doing it.

I'm not a developer myself but I know a little bit about some of the work flow. It would be really awesome if microsoft access files were similar to a visual studio solution so the entire thing could be under source control.

Are there any solutions besides manual documentation?

MS Access 2013 Main Query is Select and Sub Query is Cosstab - Getting Error

$
0
0

I have table with 3 columns to create cross tab query on

1st Column (Work Type) - Pivot In (Clean,Dity)

2nd Column (Risk) - Pivot In(Low,Medium,High)

3nd Column (Techncian Skills) - Pivot In(Low,Medium,High)

Select SNo From tbl_Staff Left Join (
TRANSFORM Count(tbl_Maint_Staff.ID) AS CountOfID
SELECT tbl_Maint_Staff.SNo
FROM tbl_Maint INNER JOIN tbl_Maint_Staff ON tbl_Maint.MID = tbl_Maint_Staff.MID
GROUP BY tbl_Maint_Staff.SNo
PIVOT tbl_Maint.WT In ("C","D")) As X On tbl_Staff.SNo = X.SNo
Where tbl_Staff.SNo=27815;

I get an error "syntax error in FROM clause".

Similarly I have two more transform query for Risk and Technical Skill to be linked to Select query.

Any one please assist will be appreciated.

Navigation Pane always visible

$
0
0

originally written ~2003 or earlier... received as a 2010.accdr - I believe as a quick & dirty method to prevent users from going into design view - - and so I changed the extension to be now 2010.accdb

seem to be able to work in new design requirements without any issues, and yet despite unchecking the Navigation Pane visible option in the Current Database profile.....the navigation pane is always visible....

have checked modules and event code in the opening form and find nothing referring to the Navigation Pane..

at the moment a real head scratcher...

Access 2013 Web App Table Selector

$
0
0

Access 2013 Web App - Can you hide and unhide tables in the table selector at run time via a macro?

Access 2010 - Form Fields not Calculating Until Clicked

$
0
0

I am working on a client's Access 2010 database. They have a tabbed form for data entry. On one form tab there are some basic financial calculations. Here is a simplified example:

[Registration Fee]  (bound to currency value in table)

[Amount Paid] = [CheckPayment] + [CashPayment] + [CreditCardPayment]  (Amount Paid is unbound calculation, adding up three bound currency values)

[Amount Due] = [Registration Fee] - [CheckPayment] - [CashPayment] - [CreditCardPayment]

(Amount Due is unbound calculation, based on four bound currency values)

When clicking over to the Financials tab, for the first record the calculated fields will be blank. If I click into one of the fields, the status bar will briefly show "Calculating..." and then the calculated amount will show up. After doing that, if I scroll to other records, they are fine. There is no VBA code associated with this form. What could be causing this delay in calculating for the first record?


Note: If I redo the calculation textboxes on the tabbed form, they exhibit the same behavior. If I create a new tabbed form, the calculation textboxes I place on it automatically calculate (normal behavior).

Find highest feet and Inches

$
0
0

Have a database with six different feet and inches per row. I am using a very complex query to find the highest feet and inches.

example:

SELECT Student.ID, Student.InMeet, Student.Student, schools.School, Student.PR, Jumps.dis_ft_1, Jumps.dis_in_1, Jumps.dis_ft_2, Jumps.dis_in_2, Jumps.dis_ft_3, Jumps.dis_in_3, Jumps.dis_ft_4, Jumps.dis_in_4, Jumps.dis_ft_5, Jumps.dis_in_5, Jumps.dis_ft_6, Jumps.dis_in_6, [dis_ft_1]*12+[dis_in_1] AS totalin1, ([dis_ft_2]*12)+[dis_in_2] AS totalin2, ([dis_ft_3]*12)+[dis_in_3] AS totalin3, ([dis_ft_4]*12)+[dis_in_4] AS totalin4, ([dis_ft_5]*12)+[dis_in_5] AS totalin5, ([dis_ft_6]*12)+[dis_in_6] AS totalin6, Maximum([totalin1],[totalin2],[totalin3],[totalin4],[totalin5],[totalin6]) AS longest, Int([longest]/12) AS longft, ([longest]/12-Int([longest]/12))*12 AS longin
FROM schools INNER JOIN (Student LEFT JOIN Jumps ON Student.ID = Jumps.student_id) ON schools.ID = Student.School
WHERE (((Student.InMeet)=True))
ORDER BY Student.ID;

Is there any to do this without converting every jump to inches?


Gary

when are we going to get access 2016 runtime?

$
0
0
when are we going to get access 2016 runtime?

MS Graph in Access 2010

$
0
0

so I have a graph created using MS Graph in Access 2010.

It used to work on all the systems.

Now it does not show up on some systems but it shows on mine.  The subform loads but the graph control is empty.

The system where it does not show is running Access 2010 14.0.7153.5000 32-bit

I am running 14.0.7159.5000 32-bit and it works on my system.  we are using the same Access frontend and backend files.

Any ideas?

Need to create a Custom Object

$
0
0

The project I have uses an Outlook Calendar to track vehicle schedule information, but getting the data from Access to Outlook into shared folders is proving vary difficult.  I have not been able to find a Calendar like add-in for Access, (if anyone knows of one please let me know, thanks) so I am considering creating my own object, however, I need assistance in finding the  best "How To" document(s).

Any help would be extremely appreciated!  Below is an image of what I am looking to create.

Run query in the background

$
0
0

I have a database which I'm working on. It is composed of split database, both front and multiple links to backend tables.

I am working on a report which is composed of 15 different sub-reports.  I have a form which allows me to input start date and end date for the report.  There's a button which generates the final report.  The problem is when I want to generate the report, I would have to re-run each of the different make-table queries for each of the sub-reports.  The issue with this is that there would be 2 warnings for each query, one to delete my table and another for rows added to the table.

I researched online and found this code to run the Execute command which will remove all the warnings.  I'm new to VB but I figured I'll give it a try and I get the following run-time error "3078: ..cannot find the input table or query..." when I execute the code: dbs.Execute sql, dbFailOnError.  I've made sure that the query was named the same but is still not working. My saved query is a make table query.  Is there a different syntax for this?

Private Sub Command28_Click()

    Dim dbs As DAO.Database
    Dim lngRowsAffected As Long
    Dim lngRowsDeleted As Long
    Dim sql$

    sql = "[qry_Maui_Division_KWH_Produced]"

    Set dbs = CurrentDb

    ' Execute runs both saved queries and SQL strings
    dbs.Execute sql, dbFailOnError

    ' Get the number of rows affected by the Action query.
    ' You can display this to the user, store it in a table, or trigger an action
    ' if an unexpected number (e.g. 0 rows when you expect > 0).
    lngRowsAffected = dbs.RecordsAffected

    dbs.Execute "DELETE FROM tbl_Maui_Division_KWH_Produced WHERE Bad", dbFailOnError
    lngRowsDeleted = dbs.RecordsAffected

End Sub



Print Button Problem

$
0
0

Hi

I have created a print button on a report which successfully prints just the current record but it insists on printing 2 copies every time.

This is the VBA for the button:-

Private Sub cmdPrint_Click()
DoCmd.PrintOut acSelection, 1, 2, acHigh, 1, 1
End Sub

Please can somebody let me know what I am doing wrong.

Thanks

Merging tables or Union Query.

$
0
0
Access 2013. It would have been nice to have a Union query that can edit or update. I created a payment advice and would like to have a combo box that shows, Agent, Customer, Creditor, Employee and other tables in one field as a choice. I see the need to have separate tables for Agent, Customer, Creditor, Employee and Other Cash Suppliers in my database, but do not understand yet what kind of merging query can give me that.

Connect many Databases to Access Form?

$
0
0

Hi everybody.

I want to know if there is a way to create a form in Access 2013 where I could connect many databases.

These databases contain Insurance information, like Clients, Payments, etc. but there is ONE database for each client, they practically are the same but have small differences.

They have asked me for a form where one can see some specific tables information together.

What I need to know is that if there is a way to create something like this on Access or if it’s necessary develop an app to achieve this requirement. 

Any help is welcomed. Thanks.

Access Web App - Lookup fields and relationships

$
0
0

Hi there,

I'm actually an Exchange guy tasked to a small DB project, so apologies that my fundamental knowledge is quite lacking. We have an Access Web App deployed to our Sharepoint and I'll simplify my scenario to simply an Employee [table] can have multiple Licenses [table]. I simply can't find a way to adjust relationships... in the Employee table, I can lookup License, but I can neither select multiple values nor view the relationship that is created from that lookup. Ideally, I'd view an employee and be able to see all related\attached licenses.

I realize it's difficult to talk that out with someone at fundamental understanding level 1; is there a good get-started resource that would naturally cover that interaction?

Much appreciated


Sultan

$
0
0

hello

Sir

i have 1 tables

1 table name... GeneralLedger...

                Fields Name....        ID...Date...Name...Narretion... Lot No/DD No... Debit...Credit...Total

i need like this Query              1     1/1/2015  ABC   Etc             25-26-27        1000      0          -1000

                                                2    1/2/2015  BCD   TcE             28-29-30          0        1300          300

                                                3  1/3/2015    ddd    Exp            195-306         200     0                 100

Email to multiple users in access

$
0
0

Hi All,

I am not sure what I am doing wrong in the VBA commands for a email to multiple users? From the access query "2_1_2_2015 Retest final list"  I am using the field "Detected" as it contains all email aliases, but for some reason I get stuck in the declaring variables?

Private Sub Command91_Click()
Dim Outlook As Outlook.Application
Dim oEmailItem As mailItem
Dim rs  As Recordset
Dim customerEmail As String
Set oEmailItem = Outlook.CreateItem(mailItem)
With oEmailItem
   Set rs = CurrentDb.OpenRecordset("select * from 2_1_2_2015 Retest final list")
   If rs.RecordCount > 0 Then
   rs.MoveFirst
   Do Until rs.EOF
      If IsNull(rs!Detected) Then
      rs.MoveNext
      Else
        customerEmail = customerEmail & rs!Email & ";"
        .To = customerEmail
        rs.MoveNext
      End If
    Loop
    Else
      Msbox "No email address!"
    End If
    .To = ""
    .CC = ""
    .Subject = "customer info"
    .attachments.Add
End With
    Exit Sub
End Sub

How to update a record with a column with lookup source that allows multiple values

$
0
0
I have a table MyTable with a column MyColumn

The  MyColumn is connect to a lookuptable MyLokkup and has the values A B and C and the property Allow Multiple Values set to Yes
How is the syntax to update MyTable with multiple value?

This is not working since access then does not perceive the values as seperate

update MyTable
set MyColumn="A;B"
where ID=4



Access / ODBC / SQL Server Error - String Data Right Truncation Error with NVARCHAR(MAX)

$
0
0

Hi All,

I was discussing at the SQL Server Migration forum about experiencing the "String Data Right Truncation" error when I used Access to update an SQL Server nvarchar(max) field. 

The migration tool - SSMA  does a bunch of really useful things but it encourages use of nvarchar(max) - there are good things about this field type, the old field type ntext is deprecated. 

I can see the data in the Access front end Form and Table (equivalent to memo field) but if I try to edit the field, Access hits an error. Discussion seems to center around the ODBC Driver for SQL Server being deficient with text transfer of 4000 characters. Since this workplace has Access 2007, 2010 and 2013, I had a go testing and found that 

Access 2007 shows the error message when the number of characters approaches 4000

Access 2010 is ok but then shows the error message when the number of characters goes higher say more than 8000

Access 2013 does not give trouble even at 50000 characters (including spaces)

I'm deciding to switch to ntext now to go live and deal with the retirement of ntext in future years. The ntext field does not seem to give issues with Access 2007.

Any tips, hints, advice, appreciated.

Thanks

Ananda

Time difference between records

$
0
0

Hello everyone,

I'm currently working on a Access 2010 (on Win7) database where I need to calculate the time difference between separate date/time fields between separate records for multiple employees. Here's and example of my table:


I need to measure in a query the time gap between each EmployeeID's EndDate to the Next StartDate. The results should look like this:


Most of the time difference between records examples I have found for this type of issue does not include the added caveat such as the EmployeeID factor. Any suggestions is appreciated.

Thank you, Kevin


Viewing all 14673 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>