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

help for Ms Access combo box only can be viewed by sa

$
0
0
I  have a Ms Access interface (which is connected to a sql Server database server),

I create a new proc for one Access combo box and I used it in Access interface. It works fine if I log in as 'sa' but not other user. Other user can't see the combo box list at all.

BTW, I grant the security for the user to execute the new proc.

And it returns expected result when log in SQL Server Management Studio(SSMS) as other user.

Please help me here!

Thanks!

Kathy


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

Cannot Open Any More Databases

$
0
0

I have a database which I'm working on.  It is composed of split database, both front and multiple links to backend which are in the same folder on my local drive.  It is in development still, so no one else is accessing it. 

I am working on a report that has 15 sub-reports.  All of the data comes from the same backend.  Each sub-report and the main report have queries as their data source.  Each query is different, except one of the sub-report queries use a common query (or common queries) as one of the sources.  When I run the report, I get the message that is in a loop which outputs "Cannot open any more databases." 

I'm assuming that access runs all the queries simultaneously which is causing the error when a common query is trying to open a source that is already in-use.  Is there a way to run through each of the sub-report individually?  In other words, run one sub-report at a time then close any of the corresponding queries and then run the next one.  I haven't tried this, but I think I can do a work around which is to get away from doing all the sub reports and just use one report and retrieve all the data that way.  Would this be the only way to fix this?

Subreport resize bug part 2: No current record

$
0
0

I asked an earlier question about the change in behavior from Access 2003 to Access 2007 regarding changing the height of a subreport control in code.  The workaround in my earlier question was to ensure that the CanGrow property was disabled for the subreport control.

Now I am bumping into a "No current record" error when I try to access the control data from within the Detail_Format event of a subreport whose corresponding subreport control is manually resized via VBA code.  The simplest way to illustrate this is with a minimal, complete, and verifiable example (MCVE) of the problem.

Please paste the following code into a standard code module in Access 2007 or later (I tested it in Access 2013).  When you run the code, it will open a report.  The report should show data in a subreport, but instead it just shows #Error and you should also receive a "No current record" error.

Upon closing this report, Access will likely crash immediately.  Is this a bug in Access 2007+?  It worked without problem in Access 2000 - 2003.

Sub ShowcaseSubreportResizeBug()
    On Error Resume Next
    CurrentDb.Execute "DROP TABLE McveChild"
    CurrentDb.Execute "DROP TABLE Mcve"
    On Error GoTo 0

    'Create a simple table to act as Recordsource
    CurrentDb.Execute "SELECT 1 AS ID INTO Mcve"
    CurrentDb.Execute "INSERT INTO Mcve(ID) Values (2)"

    'Create a second table to act as Subreport Recordsource
    CurrentDb.Execute "SELECT 1 AS ID, 1 AS ChildID INTO McveChild"
    CurrentDb.Execute "INSERT INTO McveChild(ID, ChildID) Values (1, 2)"
    CurrentDb.Execute "INSERT INTO McveChild(ID, ChildID) Values (2, 3)"
    CurrentDb.Execute "INSERT INTO McveChild(ID, ChildID) Values (2, 4)"


    'Create a subreport bound to our child table...
    Dim SubRpt As Report, SRName As String
    Set SubRpt = CreateReport
    SubRpt.RecordSource = "SELECT * FROM McveChild"
    SRName = SubRpt.Name
    '...add a text box to show the ChildID
    With CreateReportControl(SRName, acTextBox, acDetail)
        .ControlSource = "ChildID"
    End With
    DoCmd.Save , SRName
    DoCmd.Close acReport, SRName
    Set SubRpt = Nothing

    'Create the main report...
    Dim Rpt As Report, RptName As String, SRCtlName As String
    Set Rpt = CreateReport
    Rpt.RecordSource = "SELECT * FROM Mcve"
    RptName = Rpt.Name
    '...add the subreport control...
    With CreateReportControl(RptName, acSubform, acDetail)
        .SourceObject = "Report." & SRName
        SRCtlName = .Name
        .LinkMasterFields = "ID"
        .LinkChildFields = "ID"
        .CanGrow = False
    End With
    '...change the size of the subreport control in code...
    Rpt.Section(acDetail).OnFormat = "[Event Procedure]"
    Rpt.Module.InsertLines Rpt.Module.CountOfLines, vbCrLf & _"Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)" & vbCrLf & _"    Me.Child0.Height = Me.Child0.Height - 1" & vbCrLf & _"End Sub"
    '...save and close the main report
    DoCmd.Save , RptName
    DoCmd.Close acReport, RptName
    Set Rpt = Nothing

    'Preview the newly created report (this may cause msaccess.exe to hard crash upon closing the report)
    MsgBox "Click OK to observe the 'No current record' error when trying to open report, '" & RptName & "'."
    DoCmd.OpenReport RptName, acViewPreview
End Sub

How do I suppress the calander on a control set to medium time?

$
0
0
I have a control on a form bound to a date/time field.  The control and field properties are set to medium time.  When the control gains focus the calendar shows up.  This is for time entry only a date is not necessary, nor wanted.  Is it possible to suppress the calendar?

For the benefit of others, please mark posts as answered or helpful when they answer or assist you in finding the answer. ___ "We came all this way to explore the Moon, and the most important thing is that we discovered the Earth." - Bill Anders, Apollo 8.

How do i filter a subform based on a string?

$
0
0

Hello, i wonder how i filter a subform so it only shows related records to the open main record?

I have a form which displays detailed information about a client. The user are able to see all the contact information and events related to the clients.

When form B is open the subform displays all the events currently, i'm trying to filter the subform so the form to only displays the related records. If there is no related records then leave the subform empty. I have built a query which does the filter i want, however i do not know how i make the query run run since i haven't manage to change the subforms recordsource so the query could filter in the "Security Number". 

Below have i shared the forms code with images and a version of the db am building.

Form A, Lists all clients.

Option Compare Database
Option Explicit

Dim SrchVal As String
Dim SrchCrit As String
Dim LastFld As String
Dim fldName As String
Dim FlitStr As String

Private Function addCrLf(addValue As Integer) As String
    'Convenience routine to build a concatenated string of carriage returns / line feeds
    'given a specified count

    Dim intCount As Integer
    Dim strReturn As String

    strReturn = ""
        For intCount = 1 To addValue
            strReturn = strReturn & vbCrLf
        Next intCount

        addCrLf = strReturn
End Function

Private Sub FiltCITY_GotFocus()
    Me.AllowEdits = True
    If Nz(FlitStr, "") = "" Then
        Me.FiltCITY.RowSource = "SELECT DISTINCT tblClients.City FROM tblClients;"
    Else
        Me.FiltCITY.RowSource = "SELECT DISTINCT tblClients.City FROM tblClients WHERE " & FlitStr & ";"
    End If
        Me.FiltCITY.Dropdown
End Sub

Private Sub FiltCITY_LostFocus()
    Me.AllowEdits = False
End Sub

Private Sub filtORO_GotFocus()
    Me.AllowEdits = True
    If Nz(FlitStr, "") = "" Then
        Me.filtORO.RowSource = "SELECT tbl_Oro.ClassType_Oro FROM tbl_Oro;"
    Else
        Me.filtORO.RowSource = "SELECT tbl_Oro.ClassType_Oro FROM tbl_Oro WHERE " & FlitStr & ";"
    End If
        Me.filtORO.Dropdown
End Sub

Private Sub filtORO_LostFocus()
    Me.AllowEdits = False
End Sub

Private Sub filtNAME_GotFocus()
    Me.AllowEdits = True
    If Nz(FlitStr, "") = "" Then
        Me.filtNAME.RowSource = "SELECT DISTINCT tblClients.LastName FROM tblClients;"
    Else
        Me.filtNAME.RowSource = "SELECT DISTINCT tblClients.LastName FROM tblClients WHERE " & FlitStr & ";"
    End If
        Me.filtNAME.Dropdown
End Sub

Private Sub filtNAME_LostFocus()
    Me.AllowEdits = False
    Me.Refresh
End Sub
Private Sub txtClientID_DblClick(Cancel As Integer)
    Dim intID As String
    intID = Me!intID

      'DoCmd.Close acForm, "frmClientsList"
      DoCmd.Close acForm, "frmClientsMenu"
      DoCmd.OpenForm "frmClientDetails", acNormal, "", "", acReadOnly, acDialog, OpenArgs:=intID
End Sub

Private Sub btnShowClient_Click()
    Dim intID As String
    intID = Me!intID

      'DoCmd.Close acForm, "frmClientsList"
      DoCmd.Close acForm, "frmClientsMenu"
      DoCmd.OpenForm "frmClientDetails", acNormal, "", "", acReadOnly, acDialog, OpenArgs:=intID
End Sub

Private Sub lblAnmäldDatum_Click()
    If Me.OrderBy = "AnmäldDatum" Then
        Me.OrderBy = "AnmäldDatum DESC"
    Else
        Me.OrderBy = "AnmäldDatum"
    End If
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

    On Error GoTo Err_Process
      Dim ctl As control
      Dim rs As Recordset

      Select Case KeyCode
            Case vbKeyEnd
                  KeyCode = 0
                  DoCmd.RunCommand acCmdRecordsGoToLast
            Case vbKeyHome
                KeyCode = 0
                DoCmd.RunCommand acCmdRecordsGoToFirst
            Case vbKeyUp
                KeyCode = 0
                DoCmd.RunCommand acCmdRecordsGoToPrevious
            Case vbKeyDown
                KeyCode = 0
                DoCmd.RunCommand acCmdRecordsGoToNext
            Case vbKeyRight, vbKeyLeft
            Case vbKeyPageUp, vbKeyPageDown
                KeyCode = 0
            Case 9, 13    'tab or enter keys
            Case 8          'backspace key
            Case 48 To 57, 65 To 90
               Set ctl = Screen.ActiveControl
                 fldName = ctl.Name
                 Select Case UCase(fldName)
                        Case "filtNAME", "FiltCITY", "filtORO"
                            Exit Sub
                    End Select
                     If fldName <> LastFld Then
                        SrchVal = ""
                     End If
               LastFld = fldName
               SrchVal = SrchVal & Chr(KeyCode)
               KeyCode = 0
                  If fldName = "Address" Then
                     SrchCrit = "[" & fldName & "] Like '*" & SrchVal & "*'"
                  Else
                     SrchCrit = "[" & fldName & "] Like '" & SrchVal & "*'"
                  End If
               Set rs = Me.RecordsetClone
                  rs.FindFirst SrchCrit
                        If rs.NoMatch Then
                           MsgBox (" Record not found! ")
                        Else
                           Me.Bookmark = rs.Bookmark
                        End If
               rs.Close

            Case 107, 187
               If SrchVal = "" Then
                  KeyCode = 0
                  Exit Sub
               End If
               Set ctl = Screen.ActiveControl
                     fldName = ctl.Name
                     KeyCode = 0
               Set rs = Me.RecordsetClone
                     rs.Bookmark = Me.Bookmark
                     rs.FindNext SrchCrit
                           If rs.NoMatch Then
                              MsgBox (" Record not found! ")
                           Else
                              Me.Bookmark = rs.Bookmark
                           End If
                     rs.Close

            Case 109, 189
                 If SrchVal = "" Then
                    KeyCode = 0
                    Exit Sub
                 End If
                 Set ctl = Screen.ActiveControl
                     fldName = ctl.Name
                     KeyCode = 0
                 Set rs = Me.RecordsetClone
                     rs.Bookmark = Me.Bookmark
                     rs.FindPrevious SrchCrit
                           If rs.NoMatch Then
                              MsgBox (" Record not found! ")
                           Else
                              Me.Bookmark = rs.Bookmark
                           End If
                 rs.Close
            Case 27
               KeyCode = 0
               SrchVal = ""
            Case Else
               KeyCode = 0
End Select

Exit_Process:
    Exit Sub
Err_Process:
        Select Case Err.Number
        Case 2046
        Case 2474
        Case Else
            MsgBox Err.Number & " " & Err.Description
        End Select
        Resume Exit_Process
End Sub

Private Sub Form_Open(Cancel As Integer)
    'Me.OrderBy = "ID"
    Me.OrderByOn = True
      Me.AllowAdditions = False
      Me.AllowEdits = False
      Me.AllowDeletions = False


End Sub

Private Sub cmdDeleteClient_Click()
    Dim strClient As String
    If MsgBox(" Du är på väg att RADERA en KLIENT. ALLA relaterade objekt kommer att försvinna. Är du SÄKER på att du vill radera denna klienten? OBS! detta går inte att ångra! ", vbYesNo) = vbYes Then
        strClient = "Klient: " & Me!intID & " # " & Me!txtClientID & addCrLf(2) & "Namn: " & addCrLf(1) & Me!FirstName & " - " & Me!LastName & addCrLf(2)
        Me.AllowDeletions = True
        DoCmd.RunCommand acCmdDeleteRecord
        Me.AllowDeletions = False
        MsgBox (" " & strClient & " Har raderats! ")
    End If
End Sub

Private Sub lblClientID_Click()
    If Me.OrderBy = "ClientID" Then
        Me.OrderBy = "ClientID DESC"
    Else
        Me.OrderBy = "ClientID"
    End If
    Me.AllowAdditions = False
    Me.AllowEdits = False
    Me.AllowDeletions = False
End Sub

Private Sub lblePost_Click()
    If Me.OrderBy = "ePost" Then
        Me.OrderBy = "ePost DESC"
    Else
        Me.OrderBy = "ePost"
    End If
End Sub

Private Sub lblFirstName_Click()
          If Me.OrderBy = "FirstName" Then
        Me.OrderBy = "FirstName DESC"
    Else
        Me.OrderBy = "FirstName"
    End If
End Sub

Private Sub lblHomeNumnber_Click()
    If Me.OrderBy = "HomeNumnber" Then
        Me.OrderBy = "HomeNumnber DESC"
    Else
        Me.OrderBy = "LastName"
    End If
End Sub

Private Sub lblID_Click()
    If Me.OrderBy = "intID" Then
        Me.OrderBy = "intID DESC"
    Else
        Me.OrderBy = "intID"
    End If
End Sub

Private Sub lblLastName_Click()
    If Me.OrderBy = "LastName" Then
        Me.OrderBy = "LastName DESC"
    Else
        Me.OrderBy = "LastName"
    End If
End Sub

Private Sub lblPhoneNumber_Click()
    If Me.OrderBy = "PhoneNumber" Then
        Me.OrderBy = "PhoneNumber DESC"
    Else
        Me.OrderBy = "PhoneNumber"
    End If
End Sub

Private Sub lblPoastAdress_Click()
    If Me.OrderBy = "PoastAdress" Then
        Me.OrderBy = "PoastAdress DESC"
    Else
        Me.OrderBy = "LastPoastAdressName"
    End If
End Sub

Private Sub lblPostOrt_Click()
    If Me.OrderBy = "PostOrt" Then
        Me.OrderBy = "PostOrt DESC"
    Else
        Me.OrderBy = "PostOrt"
    End If
End Sub

Private Sub lblRegistreradDatum_Click()
    If Me.OrderBy = "RegistreradDatum" Then
        Me.OrderBy = "RegistreradDatum DESC"
    Else
        Me.OrderBy = "RegistreradDatum"
    End If
End Sub

Private Sub lblRegistreradesAv_Click()
    If Me.OrderBy = "RegistreradesAv" Then
        Me.OrderBy = "RegistreradesAv DESC"
    Else
        Me.OrderBy = "RegistreradesAv"
    End If
End Sub

Private Sub lblAvRegistreradDatum_Click()
    If Me.OrderBy = "AvRegistreradDatum" Then
        Me.OrderBy = "AvRegistreradDatum DESC"
    Else
        Me.OrderBy = "AvRegistreradDatum"
    End If
End Sub

Sub BuildFlitStr()
    FiltStr = ""
        If Me!NameFlit <> "" Then
            FlitStr = "[LastName] = '" & Me!filtNAME & "'"
        End If
        If Me!NameFlit <> "" Then
            If FiltStr = "" Then
                FlitStr = "[CITY] = '" & Me!FiltCITY & "'"
            Else
                FlitStr = FiltStr & " [CITY] = '" & Me!cboFliterCity & "'"
        End If
        If Me!NameFilt <> "" Then
            FlitStr = "[ORO] = '" & Me!filtORO & "'"
        End If
End Sub

Form B, Displays detailed information about a client.

Option Compare Database
Option Explicit

Dim strClientID As String

Private Sub cmdNewCase_Click()
    DoCmd.Close acForm, "frmClientDetails"
    DoCmd.OpenForm "frmErrand", acNormal, "", "", acFormAdd, acDialog
End Sub

Private Sub btnAddErrand_Click()
        Dim intID As String
        DoCmd.Close acForm, "frmMenu"
        DoCmd.Close acForm, "frmClientDetails"


        intID = Me!txtID
        DoCmd.OpenForm "frmErrandV2", acNormal, "", acFormAdd, OpenArgs:=intID
End Sub

Private Sub btnClose_Click()
    DoCmd.Close acForm, "frmClientDetails", acSaveNo
End Sub

Private Sub btnEN_Click()
            Me.lblH1.Caption = "Personal Information:"
                Me.lblClient_ID.Caption = "Security Number:"
                Me.lblFirstName.Caption = "First name"
                Me.lblLastName.Caption = "Last name"
            Me.lblH2.Caption = "Contact information"
                Me.lblAdress.Caption = "Adress"
                Me.lblZIP.Caption = "ZIP"
                Me.lblCity.Caption = "City"
                Me.lblEmail.Caption = "e-mail"
                Me.lblHomeNumber.Caption = "Home Number"
                Me.lblPhoneNumber.Caption = "Mobile Number"
            Me.lblH3.Caption = "Signature"
                Me.lblRegisteredOf.Caption = "Registered by"
                Me.lblRegisteredDate.Caption = "Registerd on"
        Me.btnAddErrand.Caption = "Add Case"
        Me.btnSave.Caption = "Save"
        Me.btnEdit.Caption = "Edit"
        Me.btnDelete.Caption = "Delete"
        Me.btnClose.Caption = "Close"
End Sub

Private Sub btnSE_Click()
            Me.lblH1.Caption = "Personuppgifter"
                Me.lblClient_ID.Caption = "Personnummer"
                Me.lblFirstName.Caption = "För Namn"
                Me.lblLastName.Caption = "Efter Namn"
            Me.lblH2.Caption = "Kontaktuppgifter"
                Me.lblCity.Caption = "Post ort"
                Me.lblAdress.Caption = "Post Adress"
                Me.lblEmail.Caption = "e-mail"
                Me.lblHomeNumber.Caption = "Hem Nummer"
                Me.lblPhoneNumber.Caption = "Mobil Nummer"
            Me.lblH3.Caption = "Signatur"
                Me.lblRegisteredOf.Caption = "Registrerades den"
                Me.lblRegisteredDate.Caption = "Registrerades av"
        Me.btnAddErrand.Caption = "Lägg till ärende"
        Me.btnSave.Caption = "Spara"
        Me.btnEdit.Caption = "Redigera"
        Me.btnDelete.Caption = "Radera"
        Me.btnClose.Caption = "Stäng"
End Sub

Private Sub Form_AfterUpdate()
    If Not IsNull(Me.OpenArgs) = 0 Then
        Dim SQL As String
                SQL = "SELECT tblErrand.ErrandID, tblErrand.ClientID, tblErrand.DatumAtgStart, tblErrand.DatumAtgSlut, tblErrand.Oro, tblErrand.Ansvarig " _& "FROM tblErrand WHERE (((tblErrand.ClientID)=" & Me.OpenArgs & "));"
            Me.subFrmClientEventSummery.Form.RecordSource = SQL
            Me.subFrmClientEventSummery.Form.Requery
    End If
End Sub

Private Sub Form_Open(Cancel As Integer)
'    MsgBox (Me.OpenArgs)
      If Nz(Me.OpenArgs) = 0 Then
            'Me.RecordSource = "tblClients"
      Else
            Me.RecordSource = "SELECT tblClients.* FROM tblClients WHERE (((tblClients.ID)=" & Me.OpenArgs & "));"
      End If

    Dim strClientID As String
            strClientID = Me.txtClientID

      'strClientID = Me.txtClientID

      'Debug.Print txtClientID
      Debug.Print strClientID
      Debug.Print Me.OpenArgs

      Me.txtID.Visible = False
      Me.btnEdit.Visible = True
      Me.btnSave.Visible = False
      Me.AllowEdits = False
      Me.AllowAdditions = False
      Me.AllowDeletions = False
End Sub

Private Sub btnSave_Click()
    If Me.btnSave.Visible = True Then
        Me.btnClose.SetFocus
        Me.AllowEdits = False
        Me.Refresh
        Me.btnSave.Visible = False
        Me.btnEdit.Visible = True
    End If
End Sub

Private Sub btnEdit_Click()
    Me.AllowEdits = True
    If Me.btnEdit.Visible = True Then
        Me.txtClientID.SetFocus
        Me.btnEdit.Visible = False
        Me.btnSave.Visible = True
    End If
End Sub

Form C, list all events registered to all clients.

Form C is a  

Sample db


What we do not know. Can we learn.

Access 2016 Bug? Property BorderStyle - None (No Border) - shows Border

$
0
0

In Access 2016 on a form:

The Property BorderStyle: None shows a red border

In previous Versions of Microsoft Office Access "None = No Border" did not show a border (what is expected)

In Access 2016 it is showing a red border (which should not be).

Please report back.




Maximize Window Access 2013

$
0
0
In Access 2013 I watched a few videos but don't achieve the result of my pages being full screen. If main menu opens submenus or forms. I do set PoP up  to yes on each page and did set up the little macro as the video suggest. It seems my pages are moving around and never really full screen.

Monthly Payments

$
0
0

I am creating a Database for work in Access,

I have made a customer table (one...) and a payments table (...to Many) 

I would like a form that sets up monthly payments automatically into the payments table (one record for each month) So I want to create all 12 monthly payments at the same time by using a form...?

I hope that is clear enough?

Please help. 

Thanks

Company Info

$
0
0
After two months and many hours I am still a rookie. What is the best way in Access 2013 to keep your companies own information. In a table or in a form in labels or text fields. I try to carry the information across to forms and reports (Invoices) but somehow still don't achieve it.

Recordset.movefirst generates runtime error 91

$
0
0

I have a recordset  and its clone that are declared as private at the top of the code:

Private Rst(1 to 2) as recordset

I fill Rst(1) in the Form Load event from a table as dbopendynaset.

I clone it for a small subroutine that identifies a specific pattern within the table.

In another subroutine when the code encounters Rst(1).MoveFirst, I get a runtime error 91 "Object variable or With block not set."

In the Watch window it reports that the Rst(1) is Nothing.  I can find nothing that would close this dataset in my code.

I encountered this before I added the clone process, so I don't think they are related, but I am baffled.

Any input is appreciated.

Marj Weir

CDO.message and .VotingOptions

$
0
0

Hi,

Thanks for taking the time to read my question.

I am currently using CDO to send emails instead of using Outlook from Access due to the security settings in Outlook that I can't seem to get around. CDO works great.

I'm wondering if anyone knows if it's possible to add VotingOptions and ReplyRecipients with CDO. I tried the following but it does not seem to work:

Function SendMailVote(wTo As String, wFrom As String, tMsg As String, tSubject As String, tReplyRec As String, Optional tAtt As String) 'system error messages
'http://www.rondebruin.nl/win/s1/cdo.htm
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant

    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")

        'iConf.Load -1    ' CDO Source Defaults
        Set Flds = iConf.Fields
        With Flds
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
                           = "smtp.nutreco.local"
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
            .Update
        End With

    With iMsg
        Set .Configuration = iConf
        .To = wTo
        .CC = ""
        .BCC = ""
        .FROM = wFrom
        .Subject = tSubject
        .HTMLBody = tMsg
        .VotingOptions = "Accept;Reject;Follow Up" 'Fails
        .ReplyRecipients.Add "Reply@TestReply.com" 'Fails
        .Send
    End With
End Function

Any help would be great.

Thanks,
Brad

Update: I found this

.replyto =

to replace .ReplyRecipients.Add

and it works.

Microsoft Access can't append all the records in the append query.

$
0
0
Hi all,
 
I found numerous threads online about my problem but the I'm very new to access and therefore it's hard to understand.
 
I'm having the following problem with my Access Database. 
 
Microsoft Access set 0 fields to Null due to a type of conversion failure, and it didn't add 0 records to the table due to key violations, 0 records due lock violations, and 0 records due to validation rule violations. Do you want to run query anyway?
 
I'm using Acces 2013.And I have imported SharePoint List Data in Access 2013.
 

Here Following is My Query
 
INSERT INTO [Content Metadata Master] ([Content Name], [Metadata Name], [Value])
SELECT Content.Name as [Content Name], 'Author 1' as [Metadata Name] , [Gold Metadata].[Author 1] as Value1
FROM Content, [Gold Metadata]
WHERE ((([Gold Metadata].[Case Number])='OM-0057' And ([Gold Metadata].[Case Number])=[Content].[Name]));

 
Can anyone please help me explain in baby language how this problem occurs and how to resolve it without losing data.
 
Many Thanks,
 
Samadhan

Run an Access database form cloud/Office 365/Sharepoint, etc.

$
0
0

Hello,

I have an Access 2013 database that compares products.  There are several forms with several ways of comparing these products.  It is about 32Kb in size.  

What we'd like is to be able to run the thing without the user having to load it onto their local computer.

Does anyone have the best way to do this, without converting it to SQL or HTML or anything else.  I'd like to keep it as an Access database because I'd like to retain ownership for various reasons.

I put it on our Sharepoint, but when clicked it downloads it to the users local...is there a way to stop that so it just runs from Sharepoint?

What about Office 365? Can I run an Access db from there?

We have our own Cloud, what about that?

Thank you in advance for any help you can give me.


Gee

What is wrong here?

$
0
0
Sub Backup()

Dim strPath, strBackup As String
Dim sbakfile As String
Dim fso As New FileSystemObject
Set fso = CreateObject("Scripting.FileSystemObject")



strPath = CurrentProject.Path & "\DONOTUSE_OutreachMemberDatabase.accdb"
strBackup = "\\ment2\staff\OUTREACH SERVICES\Outreach\BuckeyeOutreachBackup\" & "DONOTUSE_OutreachMemberDatabase" & Format(Date, "dddd") & ".accdb"
fso.CopyFile strPath, strBackup

If strBackup Then
MsgBox "Backup was successful and saved  " & "Backup Completed"

Else
MsgBox "Backup Database not found  " & "Backup Failed"

End If

End Sub
fso.CopyFile strPath, strBackup keeps freaking out the compiler. Why?

Increment a number using Select

$
0
0

How would I increment a number using this query:

SELECT [%$##@_Alias].student, Max([%$##@_Alias].TheJump) AS MaxJump
FROM (SELECT student,totalin1 AS TheJump
   FROM Totalin
   UNION 
   SELECT student,totalin2 AS TheJump
   FROM Totalin
   UNION
   SELECT student,totalin3 AS TheJump
   FROM Totalin
)  AS [%$##@_Alias]
GROUP BY [%$##@_Alias].student
ORDER BY Max([%$##@_Alias].TheJump) DESC;

I want to add a filed call place starting with 1 then increment it by 1

I got the original query off here by can't find it now.


Gary

How to migrate Access 97/2003 format database to the latest version 2013?

$
0
0

Hi i have been trying to convert a 97 access database to the latest accdb format. But it hasn't been that fruitful. When i open the database in 2010 access, it prompts for conversion to accdb, which otherwise wont let me view the original db i.e mdb format. 

Looking forward to any solution. Thank You :) 

Dave.

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.

using alter table on back end database causes front end database to no longer be in exclusive mode to edit forms

$
0
0

when I run code to alter a table on the back end - testing updates - I'm no longer able to modify the form on the front end - it takes me out of exclusive mode - is there a way to stop this behavior?

the code I'm using to alter the database is below (also if there is a way to combine all my alter table statements I'd really appreciate it - I tried several renditions and kept getting syntax errors)

    Dim strSQL As String
    Dim dbLocation As String
    Dim dbs As Database

    dbLocation = Trim(Nz(Me.DataPath, ""))

    If Len(dbLocation) = 0 Then
        MsgBox "Data path required", vbCritical
    Else
        Set dbs = OpenDatabase(dbLocation)
        strSQL = "ALTER TABLE tblPT_STmemos ADD COLUMN Subjective memo"
        dbs.Execute strSQL, dbFailOnError
        strSQL = "ALTER TABLE tblPT_STmemos ADD COLUMN Objective memo"
        dbs.Execute strSQL, dbFailOnError
        strSQL = "ALTER TABLE tblPT_STmemos ADD COLUMN Assessment memo"
        dbs.Execute strSQL, dbFailOnError
        strSQL = "ALTER TABLE tblPT_STmemos ADD COLUMN Plan memo"
        dbs.Execute strSQL, dbFailOnError
        strSQL = "UPDATE tblPT_STmemos SET tblPT_STmemos.Subjective = SOAP"
        dbs.Execute strSQL, dbFailOnError
        strSQL = "ALTER TABLE tblPT_STmemos DROP COLUMN Soap"
        dbs.Execute strSQL, dbFailOnError
        dbs.Close
        Set dbs = Nothing
        MsgBox "Update Complete", vbInformation, "Update Database"
        Me.DataPath.SetFocus
        Me.cmdUpdateDatabase.Visible = False
    End If


For the benefit of others, please mark posts as answered or helpful when they answer or assist you in finding the answer. ___ "We came all this way to explore the Moon, and the most important thing is that we discovered the Earth." - Bill Anders, Apollo 8.

Is it possible?

$
0
0
Is it possible to auto backup an Access 2010 database to different server on a network?
Viewing all 14673 articles
Browse latest View live


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