Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Data/ This could be a challenge !!!

Status
Not open for further replies.

Shadez

Programmer
Jul 5, 2001
57
0
0
US
OK I'm back and this time I actually have a question I believe may prove tricky.

My application has 2 different datasources. One of these is locked so no edits can be made. The other is freely editable. I have a tool that allows the user to decide what records they wish to include in the editable section. Hope I did not lose to many people there.

Now if someone looks up a record with a order history and one of the customers has not been added to the local data yet. I need a way for this to be done. I have a field that actually contains the key field information in it so that a comparison and lookup is made easy.

What I need to do is have it so that when an event (button/click/doule click field) the program first checks to see if this record is contained locally. If it is not it prompts the user asking if they wish to add this user to the local listings. At this point the data is grabbed from one datasource to the local one and the local record is opened.

I know this may sound confusing , but I would really appreciate any assistance here.

Thanks in Advance
 
I see this being able to be done through VBA. Steps something like:

1. Button click - start function
2. SQL to look for your record on local end
3. If not found SQL to copy from distant to local
4. Requery to find in local end
5. Allow edit of local end

What happens then? Since the distant end is not updateable, how do you send it back (or do you?)

If this isn't enough, please copy your table structure here so that one of us can help you. Terry M. Hoey
 
Nope that is exactly what i am trying to do, I don't actually have it looked up on button I double click the field. The non local data is accessed by many others so they can't update that. They can however alter the local data. As I am still confused on the how tos of what you suggest could, you possible give and example.
 
here is the code to find something using a SQL string

Dim db as database
Dim rst as recordset
Dim SQL as string

Set db = currentdb
SQL = "Select * From [YourTable] Where [somefield] = '" & SomeValue & "';"
Set Rst = db.openrecordset(SQL)

SomeotherValue = rst![anyFieldinTable]

rst.close
db.close

Copy this and keep it handy its 90% of what I do all day long.
VBA, Learn it, Know it, Love it.
"VBA-LIKILI" = $$$$$$$$$
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top