Help me figure out what this db is doing in exchange for something

G

Guest

I have a large complex database, that I know nothing about, and I need to
know what it is doing? Where it is getting or trying to get its information,
and stuff like that.

There shouldn't be any need to design, create, or write any code, tables,
forms, etc...

I just need to have you look at the database, and answer my questions like
something of this nature.

Where is table "XYZ" getting or trying to get its information?

Please Help
 
G

Guest

Open the reports, forms, and queries in design view.

Right click and select properties (at the bottom of list).

Look for the source property and that will tell you where it gets the data.
 
J

John Vinson

Where is table "XYZ" getting or trying to get its information?

As phrased, the question's only answer is "from table XYZ".

A table is a static object; it doesn't "get" information from
anywhere, other objects (forms, reports, queries) get information from
it!

What "something" are you offering in exchange? Analyzing the structure
of a database can be pretty easy or an absolute nightmare, depending
on how well it was designed and commented; I'd be reluctant to offer
without some more information!

John W. Vinson[MVP]
 
G

Guest

Thank you, your answer did help, and will continue to help me. However my
biggest problem is understading the modules. For example here is an "Event
Procdure" that I'm not sure what it is doing. I plan in the next day or two
to go and get a book on Visual Basic to start studying so that I can
understand what it is something like this event procedure is trying to do?

Option Compare Database
Option Explicit

Private Sub CmdExit_Click()

On Error GoTo Err_CmdExit_Click

DoCmd.CLOSE

Exit_CmdExit_Click:
Exit Sub

Err_CmdExit_Click:
MsgBox Err.DESCRIPTION
Resume Exit_CmdExit_Click

End Sub

Private Sub cmdUpdate_Click()

Dim bSelected As Boolean

'Initialize
bSelected = False

'Delete US and INV AFEs (excluding CFOL)
DoCmd.SetWarnings False
DoCmd.OpenQuery "qDelete_NONCFOL_AFES"
DoCmd.SetWarnings True

'Check for a Source selection
If cboSource = "UNKNOWN" Then
MsgBox "Select a Source - it can not be left as UNKNOWN!",
vbCritical, "Source Missing"
Exit Sub
End If

'Check for a Business Unit selection
If IsNull(cboBusinessUnit) Then
MsgBox "Select a Business Unit!", vbCritical, "Business Unit Missing"
Exit Sub
End If

'Check for a Year
If IsNull(cboYear) Then
MsgBox "Select a Year!", vbCritical, "Year Missing"
Exit Sub
End If

Dim lngFlags As Long
Dim gfni As adh_accOfficeGetFileNameInfo
Dim sFileName As String

On Error GoTo HandleErrors

'Initialize
sFileName = IIf(IsNull(Me!txtResults), "", Me!txtResults)

With gfni
.lngFlags = lngFlags
' Make sure not to pass in Null values. adhOfficeGetFile
' doesn't like that, and often GPFs.
.strFilter = "MS Excel (*.xls)|All Files (*.*)"
.lngFilterIndex = 0
.strFile = "CAPEX REPORT.xls"
.strDlgTitle = "Open Accounting MS Excel"
.strOpenTitle = "Open"
.strInitialDir = ""
End With

'Mode = 0 is to OPEN, (versus 1 = SAVE)
If adhOfficeGetFileName(gfni, 0) = adhcAccErrSuccess Then

Me!txtResults = Trim(gfni.strFile)

'Get the AFE data
bOK = ImportBusinessUnitCapex(txtResults, cboSource,
cboBusinessUnit, cboYear)

End If

DoCmd.OpenQuery "qDELETE_0_AFE_RECORDS"

If bOK Then
MsgBox "Import successful!", vbExclamation, "IMPORT SUCCESSFUL"
Else
MsgBox "Import unsuccessful!", vbCritical, "IMPORT UNSUCCESSFUL"
End If

ExitHere:
Exit Sub

HandleErrors:
MsgBox "Error: " & Err.DESCRIPTION & " (" & Err.Number & ")"
Resume ExitHere

Exit Sub

End Sub

Private Function ImportBusinessUnitCapex(sFileName As String, sSource As
String, sBusinessUnit As String, sYear As String) As Boolean

Dim sSQL As String, sWhere As String
Dim bWhere As Boolean
Dim sTable(11) As String
Dim J As Byte

On Error GoTo Err_ImportBusinessUnitCapex

'Initialize
sTable(9) = "AFE_DOLLARS"
sTable(10) = "AFE_DOLLARS_OTHER"
sTable(11) = "CURRENT_AFE_LIST"

'Build the Where clause
sWhere = ""
bWhere = False

'Source
If sSource <> "**ALL**" Then
sWhere = " WHERE [SOURCE] = '" & sSource & "'"
bWhere = True
End If

'Business Unit
If sBusinessUnit <> "**ALL**" Then
If bWhere Then
sWhere = sWhere & " AND [REGION] = '" & sBusinessUnit & "'"
Else
sWhere = " WHERE [REGION] = '" & sBusinessUnit & "'"
bWhere = True
End If
End If

'Project Year
If sYear <> "**ALL**" Then
If bWhere Then
sWhere = sWhere & " AND [PROJECT_YEAR] = " & sYear
Else
sWhere = " WHERE [PROJECT_YEAR] = " & sYear
bWhere = True
End If
End If

'Add the ALLOW_DELETE part
'goofy 2002.08.02 sWhere = sWhere & IIf(InStr(sWhere, "WHERE") > 0, " AND
", " WHERE ") & " [ALLOW_DELETE] = Yes;"

'Delete old AFE related records and import new ones
'=============
DoCmd.SetWarnings False

'Get the AFE data
bOK = GetCurrentAFEList(Me!txtResults, "AFE_DOLLARS",
"IRR_AFE_DOLLARS", sWhere)

DoCmd.SetWarnings True

'Modify certain AFE names with Business Unit names as suffixes
Modify_AFE_Suffixes

'OK
ImportBusinessUnitCapex = True

Exit Function

Err_ImportBusinessUnitCapex:
MsgBox "Error: " & Err.DESCRIPTION & " (" & Err.Number & ")"
ImportBusinessUnitCapex = False
Resume Next

End Function
 
G

Guest

I'm sorry, I should have been more clear. I'm having a hard time
understanding the "Event Procedures" and what it is they are trying to do,
and where they are trying to grab information from. I'm going to try and buy
a book on Visual Basic in the next day or two to try and figure it out. For
example, Here is just one "Event Procedure that I'm trying to figure out"
As far as exchange, I'm not sure. Cash, Brand New Dell 16 Port Hub, Brand
new Ethernet cards, baseball, football, basketball cards. I don't know, I'm
just doing this on my own, just trying to learn it and become more familiar
with this stuff.

Option Compare Database
Option Explicit

Private Sub CmdExit_Click()

On Error GoTo Err_CmdExit_Click

DoCmd.CLOSE

Exit_CmdExit_Click:
Exit Sub

Err_CmdExit_Click:
MsgBox Err.DESCRIPTION
Resume Exit_CmdExit_Click

End Sub

Private Sub cmdUpdate_Click()

Dim bSelected As Boolean

'Initialize
bSelected = False

'Delete US and INV AFEs (excluding CFOL)
DoCmd.SetWarnings False
DoCmd.OpenQuery "qDelete_NONCFOL_AFES"
DoCmd.SetWarnings True

'Check for a Source selection
If cboSource = "UNKNOWN" Then
MsgBox "Select a Source - it can not be left as UNKNOWN!",
vbCritical, "Source Missing"
Exit Sub
End If

'Check for a Business Unit selection
If IsNull(cboBusinessUnit) Then
MsgBox "Select a Business Unit!", vbCritical, "Business Unit Missing"
Exit Sub
End If

'Check for a Year
If IsNull(cboYear) Then
MsgBox "Select a Year!", vbCritical, "Year Missing"
Exit Sub
End If

Dim lngFlags As Long
Dim gfni As adh_accOfficeGetFileNameInfo
Dim sFileName As String

On Error GoTo HandleErrors

'Initialize
sFileName = IIf(IsNull(Me!txtResults), "", Me!txtResults)

With gfni
.lngFlags = lngFlags
' Make sure not to pass in Null values. adhOfficeGetFile
' doesn't like that, and often GPFs.
.strFilter = "MS Excel (*.xls)|All Files (*.*)"
.lngFilterIndex = 0
.strFile = "CAPEX REPORT.xls"
.strDlgTitle = "Open Accounting MS Excel"
.strOpenTitle = "Open"
.strInitialDir = ""
End With

'Mode = 0 is to OPEN, (versus 1 = SAVE)
If adhOfficeGetFileName(gfni, 0) = adhcAccErrSuccess Then

Me!txtResults = Trim(gfni.strFile)

'Get the AFE data
bOK = ImportBusinessUnitCapex(txtResults, cboSource,
cboBusinessUnit, cboYear)

End If

DoCmd.OpenQuery "qDELETE_0_AFE_RECORDS"

If bOK Then
MsgBox "Import successful!", vbExclamation, "IMPORT SUCCESSFUL"
Else
MsgBox "Import unsuccessful!", vbCritical, "IMPORT UNSUCCESSFUL"
End If

ExitHere:
Exit Sub

HandleErrors:
MsgBox "Error: " & Err.DESCRIPTION & " (" & Err.Number & ")"
Resume ExitHere

Exit Sub

End Sub

Private Function ImportBusinessUnitCapex(sFileName As String, sSource As
String, sBusinessUnit As String, sYear As String) As Boolean

Dim sSQL As String, sWhere As String
Dim bWhere As Boolean
Dim sTable(11) As String
Dim J As Byte

On Error GoTo Err_ImportBusinessUnitCapex

'Initialize
sTable(9) = "AFE_DOLLARS"
sTable(10) = "AFE_DOLLARS_OTHER"
sTable(11) = "CURRENT_AFE_LIST"

'Build the Where clause
sWhere = ""
bWhere = False

'Source
If sSource <> "**ALL**" Then
sWhere = " WHERE [SOURCE] = '" & sSource & "'"
bWhere = True
End If

'Business Unit
If sBusinessUnit <> "**ALL**" Then
If bWhere Then
sWhere = sWhere & " AND [REGION] = '" & sBusinessUnit & "'"
Else
sWhere = " WHERE [REGION] = '" & sBusinessUnit & "'"
bWhere = True
End If
End If

'Project Year
If sYear <> "**ALL**" Then
If bWhere Then
sWhere = sWhere & " AND [PROJECT_YEAR] = " & sYear
Else
sWhere = " WHERE [PROJECT_YEAR] = " & sYear
bWhere = True
End If
End If

'Add the ALLOW_DELETE part
'goofy 2002.08.02 sWhere = sWhere & IIf(InStr(sWhere, "WHERE") > 0, " AND
", " WHERE ") & " [ALLOW_DELETE] = Yes;"

'Delete old AFE related records and import new ones
'=============
DoCmd.SetWarnings False

'Get the AFE data
bOK = GetCurrentAFEList(Me!txtResults, "AFE_DOLLARS",
"IRR_AFE_DOLLARS", sWhere)

DoCmd.SetWarnings True

'Modify certain AFE names with Business Unit names as suffixes
Modify_AFE_Suffixes

'OK
ImportBusinessUnitCapex = True

Exit Function

Err_ImportBusinessUnitCapex:
MsgBox "Error: " & Err.DESCRIPTION & " (" & Err.Number & ")"
ImportBusinessUnitCapex = False
Resume Next

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top