What do i have to write in VB in module to open a specific form when i first open the access database?
341465
Here are 3 ways...\n1. You don't need code if you just set your startup form under the TOOLS, STARTUP option.\n\n2. You can create an AutoExec macro the has an OpenForm command in it.\n\n2. If you really want to do this in a module.  Create an AutoExec command that has a RunCode statement.  The function for the RunCode would be a function you create like:\n\nOpenStartForm()\n\nIn a module you would then need:\n\nFunction OpenStartForm()\nDoCmd.OpenForm "frmMyForm"\nEnd Function
868155
MS-Access is generally regarded as a backend tool (a tool for storage of data). You have to use some front end tool like VB with Access. In such a case you  have to write snippets that manipulate the data and return a result from the backend. Inturn this front end can be converted into an executable file.\n\nVB is just an example of front-end tool that can be used . You can also use ASP, PHP, CFML, Flash files as the front end.
359358
The easy way to write a SQL script is to go into Access, create a query, and then view the SQL source behind it.
699351
In design mode of the form, you can use the toolbox to add fields to your form.  Once they are there, you can use the properties dialog to "tie" a table column to that particular field.  When you open the form, you should be able to see the information from that field.\n\nIf your form is based on a query, you'll need to modify the query to ensure the additional field you're interested in is part of the query.  Once the query is updated, you can modify the form to add the additional field.\n\nA "quick and dirty" way is to create a brand new form using one of the wizards and just include the additional fields from there.  If you have a lot of customizations, this may not be the best way - but it's certainly very fast.
757129
for sure you can access any thing in a form from another one . but only if you define it as public.\nyou can use public variables , public functions or public properties.\nlet assume that we wanna calculate the total in Form1 and access it from From2.\n\nif you want to have an uncontrolled access(free read and change) it's better to use a public variable.\n\nif you want to just read (and no changes) it's better you use public functions.\n\nand finally if you wanna have a controlled access (read it and verify and control changes ) it's better to use public properties.\n\nif it's not clear enough and you want more explains or samples please feel free to contact me on email address MZR_IR@YAHOO.COM\ngood luck.
426878
write a vb6 procedure open a new recordset using your ado connection and write the sql statemtn to select the data from the 2 tables that you want. then save this into a module and then call it from your data report.
103793
I presume your talking about project done in access db itself. Go to the tools menu and select the "Startup" option. It is here you can setup how your access application starts up. For more information see the help files\n\nHope this helps
775038
Nope, sorry.  What you're describing is a query.  Only Access can do that.  It's a pretty simple one, and exporting back and forth between Access and Excel is pretty easy.  If you want some help in how to do it, send me a message.
123651
You can do it in Visual Basic by defining a subroutine that will be called just before the document is printed:\n\nPublic WithEvents appWord As Word.Application\n\nPrivate Sub appWord_DocumentBeforePrint _\n        (ByVal Doc As Document, _\n        Cancel As Boolean)\n\nDim s As Shape\n\nFor Each s In Doc.Shapes\nIf s.Type = msoTextBox Then\n    s.Line.Visible = msoFalse\n    End If\nNext s\n\nEnd Sub\n\nThe problem is, it's a little bit tricky getting this routine hooked into the application event handler.  Translation:  I didn't get it to work.  Look at the documentation for the DocumentBeforePrint event for details on what to do.
488741
You would have to either write an interface between COBOL program and MS Access, or dump the data base to a text file and have COBOL read the text file. Either way, you would have to write the COBOL program.\n\nIf you are loading to a relational data base, just use Access.
171968
Microsoft Access has two built-in security features for protecting your database: \n• User/Group accounts and permissions \n• Database passwords \n\n---------------------------------------------\nBy using code, you can prompt for a password when a user opens a form or a report. If the correct password is entered, the form or the report is opened.\n\nThe following example shows you how you can password protect the Orders form in the sample database Northwind.mdb: \n1. Start Access and then open the sample database Northwind.mdb. \n\n2. Press ALT+F11 to start the Microsoft Visual Basic editor. \n\n3. On the Insert menu, click Module. \n\n4. In the module sheet, type the following procedure:\n\nPublic MyPassword\nPublic Function KeyCode(Password As String) As Long\n   ' This function will produce a unique key for the\n   ' string that is passed in as the Password.\n   Dim I As Integer\n   Dim Hold As Long\n\n   For I = 1 To Len(Password)\n      Select Case (Asc(Left(Password, 1)) * I) Mod 4\n      Case Is = 0\n         Hold = Hold + (Asc(Mid(Password, I, 1)) * I)\n      Case Is = 1\n         Hold = Hold - (Asc(Mid(Password, I, 1)) * I)\n      Case Is = 2\n         Hold = Hold + (Asc(Mid(Password, I, 1)) * _\n            (I - Asc(Mid(Password, I, 1))))\n      Case Is = 3\n         Hold = Hold - (Asc(Mid(Password, I, 1)) * _\n            (I + Len(Password)))\n   End Select\n   Next I\n   KeyCode = Hold\nEnd Function\n\n \n5. Press ALT+F11 to return to Access. \n\n6. In the Database window, under Objects, click Tables, and then click New. \n\n7. In the New Table dialog box, double-click Design View. \n\n8. Create a new table as follows:   \n   \n   Table: tblPassword\n   ---------------------------\n   Field Name: ObjectName\n      Data Type: Text\n      Field Size: 50\n   Field Name: KeyCode\n      Data Type: Text\n      Field Size: 25\n      Input Mask: Password\n\n   Table Properties: tblPassword\n   -----------------------------\n      PrimaryKey: ObjectName\n\n \n9. Open the tblPassword table and then enter the following data:     \n       ObjectName: Orders\n       KeyCode: 2818\n\n10. Create a new form in design view and save the form as frmPassword. \n\n11. Add a single textbox to frmPassword called Text0, and a command button called CheckPassword. \n\n12. Set the Input Mask property of Text0 to "PASSWORD" (minus the quotation marks). \n\n13. Add the following code to the OnClick Event of the CheckPassword button and then save the form:\n\nIf IsNull(Forms!frmPassword!Text0.Value) Then\n   MsgBox "You cannot enter a blank Password. Try again."\n   Me!Text0.SetFocus\nElse\n   MyPassword = Me!Text0.Value\n   DoCmd.Close acForm, "frmPassword"\nEnd If\n\n14. Open the Orders form in Design view. \n\n15. If the property sheet is not visible, click Properties on the View menu. \n\n16. Type the following event procedure in the module for the OnOpen property of the form:\n\nPrivate Sub Form_Open(Cancel as Integer)\n   Dim Hold As Variant\n   Dim tmpKey As Long\n   Dim I As Integer\n   Dim rs As DAO.Recordset\n   Dim db As DAO.Database\n\n   On Error GoTo Error_Handler\n   ' Prompt the user for the Password.\n   DoCmd.OpenForm "frmPassword", acNormal, , , , acDialog\n            Hold = MyPassword\n' Open the table that contains the password.\n   Set db = CurrentDb\n   Set rs = db.OpenRecordset("tblPassword", dbOpenTable)\n   rs.Index = "PrimaryKey"\n   rs.Seek "=", Me.Name\n   If rs.NoMatch Then\n      MsgBox "Sorry cannot find password information. Try Again"\n      Cancel = -1\n   Else\n      ' Test to see if the key generated matches the key in\n      ' the table; if there is not a match, stop the form\n      ' from opening.\n      If Not (rs![keycode] = KeyCode(Cstr(Hold))) Then\n         MsgBox "Sorry you entered the wrong password." & _\n            "Try again.", vbOKOnly, "Incorrect Password&qu
331696
Use the VB Connection Wizard!
860078
You need to go into administratror tools within the operating system.  Select Computer Management, Shared Folders, Open Files and see if the Access Database in question is open.  This has to be done on the computer that has the database file.  If it shows up on the list of open files, select all instances and select close / disconnect open files.  This should allow you to compact and repair the database if needed or simply remove it.
399162
There are numerous ways and programs that Access could be programmed to integrate with.\n\n1.  If you have an API(.DLL) for another software, then you can call it's functions from VBA Code inside Access.  \n\n2.  If you want to use OLE, you can control other running software like any of the other Office applications.\n\n3.  If you need to export or import data from another software package, then code can be written in Access to build or read in files from whatever format is necessary to integrate.
670070
 Dim frmName As String\n   \n frmName = "form2"\n   \n Select Case frmName\n  Case "form1"\n   Form1.Show\n  Case "form2"\n   Form2.Show\n  Case "form3"\n   Form3.Show\n  Case Else\n   MsgBox "Invalid form name"\n End Select\n\n***EDIT***\nIn VB, you can't convert a string object into a form object.  This is why String.Show doesn't work.  However, you can use a "select case" on the string and if the string matches the form name (i.e. form2), then show the form.\n\nAnother alternative is to loop through the forms collection until you find a form with the same name as your string.\n\nIn any case, if you create a project with 2 forms (called form1 and form2).  Add a button to form1 and paste the above code into the click event of the button.  When pressed, form2 will be displayed.
62810
You can't normally do it as a database file can't be changed into an executable file. You could write macros or program some Visual Basic classes and forms to have the database file contain an independent interface and save that as an executable.
825954
You need the following:\nOpen your file\nGo to \nTools > Macro > Visual Basic editor\nIn the left window section (Project Explorer) double click on what says "Workbook"\nPaste this in the white code area that shows\n\nPrivate Sub Workbook_Open()\nWorksheets("Main").Activate\nEnd Sub\n\nThis is a macro so you will need to enable macros every time you opened this file.\nGo to\nTools > Macro > Security\nAnd change the settings to Medium\n\nEnjoy my profile, I am the VBAXLMan