?
Solved

save data from form to text file.

Posted on 2009-04-28
2
Medium Priority
?
400 Views
Last Modified: 2013-11-28
I have about 14 concurrent user using an access form on their desktop.  They keep locking each other out of the database. The database is split with the frontend ( forms, queries, reports and some tables used to feed dropdown lists) on the PC.  The data tables reside on the network.  I form is currently bound to the backend tables.  I would like to make the form unbound with a submissions that would insert the form record info the a text file,  then link the text file to the backend.  This should eliminate the concurrent user conflicts.   The form only has 4 elements so I think that is the best solution.


Thoughts
0
Comment
Question by:eyes59
2 Comments
 
LVL 11

Accepted Solution

by:
mildurait earned 2000 total points
ID: 24255638
You would need to create VBA subs to read/write records, and fire getRecord from a listbox and save record from a command button.
Example below using genering table/control names.

Sub GetRecord()        
        Dim rs as dao.recordset
        set rs = currentdb.openrecordset("SELECT * FROM tblRecord WHERE RecID=" & NZ(me.lboRecordID,0))
        With rs
             If .eof then
                     me.txtRecordName.value = .fields("sRecordName").value
                     me.txtRecordNo.value = .fields("sRecordNo").value
                     me.txtRecordDate.value = .fields("dRecordDate").value
                     me.chkRecordActive.value = .fields("bRecordActive").value
             Else
                     me.txtRecordName.value = .fields("sRecordName").value
                     me.txtRecordNo.value = .fields("iRecordNo").value
                     me.txtRecordDate.value = .fields("dRecordDate").value
                     me.chkRecordActive.value = .fields("bRecordActive").value
             End If
         End with
         rs.close
         set rs = nothing
End Sub

Sub SaveRecord()
         Dim rs as dao.recordset
        set rs = currentdb.openrecordset("SELECT * FROM tblRecord WHERE RecID=" & NZ(me.lboRecordID,0),dbOpenDynaset,dbSeeChanges)
        With rs
              If .eof then .addnew else .edit
              .fields("sRecordName").value = me.txtRecordName.value
              .fields("iRecordNo").value = me.txtRecordNo.value
              .fields("dRecordDate").value = me.txtRecordDate.value
              .fields("bRecordActive").value = me.chkRecordActive.value
              .update
         End with
         rs.close
         set rs = nothing
         me.lboRecordID.requery
         me.lboRecordID.value = null
End Sub
                     


0
 

Author Closing Comment

by:eyes59
ID: 31575697
THANKS
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question