Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 457029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:31:47+00:00 2026-05-12T22:31:47+00:00

please tell me how to change this access code so that radio buttons are

  • 0

please tell me how to change this access code so that radio buttons are removed and on clicking the import button itself the all 4 excel sheets are imported ( in other words code of all 4 radio buttons is excecuted ). I’ll be glad if you can help me out however negative comments are most welcome as well 🙂

Option Compare Database
Option Explicit


Private Sub cmdImport_Click()
On Error Resume Next
If IsNull(Me.txtFileName) Or Len(Me.txtFileName & "") = 0 Then
    MsgBox "please select the excel file"
    Me.cmdSelect.SetFocus
    Exit Sub
End If
Select Case Me.FrameSheet
    Case 1
    CurrentDb.Execute "delete * from Sheet1"
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet1", Me.txtFileName, True, "incoming calls!"
    Case 2
    CurrentDb.Execute "delete * from Sheet2"
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet2", Me.txtFileName, True, "incoming sms!"
    Case 3
    CurrentDb.Execute "delete * from Sheet3"
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet3", Me.txtFileName, True, "outgoing calls!"
    Case 4
    CurrentDb.Execute "delete * from Sheet4"
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet4", Me.txtFileName, True, "outgoing sms!"

    Case Else
    MsgBox "Select which Sheet you want to import"
    Exit Sub


End Select

End Sub

Private Sub cmdQuit_Click()
'    DoCmd.Quit
DoCmd.Close acForm, Me.Name
End Sub

Private Sub cmdSelect_Click()

    Dim strStartDir As String

    Dim strFilter As String
    Dim lngFlags As Long

    ' Lets start the file browse from our current directory

    strStartDir = CurrentDb.Name
    strStartDir = Left(strStartDir, Len(strStartDir) - Len(Dir(strStartDir)))


    strFilter = ahtAddFilterItem(strFilter, _
                        "Excel Files (*.xls)", "*.xls")
    Me.txtFileName = ahtCommonFileOpenSave(InitialDir:=strStartDir, _
                     Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
                     DialogTitle:="Select File")


End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:31:47+00:00Added an answer on May 12, 2026 at 10:31 pm

    Just remove the actual select statement

    something like this

    Private Sub cmdImport_Click()
        On Error Resume Next
        If IsNull(Me.txtFileName) Or Len(Me.txtFileName & "") = 0 Then
            MsgBox "please select the excel file"
            Me.cmdSelect.SetFocus
            Exit Sub
        End If
    
            CurrentDb.Execute "delete * from Sheet1"
            DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet1", Me.txtFileName, True, "incoming calls!"
    
            CurrentDb.Execute "delete * from Sheet2"
            DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet2", Me.txtFileName, True, "incoming sms!"
    
            CurrentDb.Execute "delete * from Sheet3"
            DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet3", Me.txtFileName, True, "outgoing calls!"
    
            CurrentDb.Execute "delete * from Sheet4"
            DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Sheet4", Me.txtFileName, True, "outgoing sms!"
    
        End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've recently written this with help from SO. Now could someone please tell me
Please don't answer the obvious, but what are the limit signs that tell us
Please can someone tell me why this isn't working before I defenestrate everything on
Somebody please tell me it is possible to recover Visual Studio source after VS
Can you please tell me how much is (-2) % 5 ? According to
Could someone please tell me which objects types can be tested using Regular Expressions
Can anyone please tell me if Certifying Authorities (CAs) are allowed to make modifications
Could somebody please tell me what is Memory Page Out Rate. I have seen
Please consider this example class: [Serializable] public class SomeClass { private DateTime _SomeDateTime; public
While cleaning some code today written by someone else, I changed the access modifier

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.