Option Compare Database
Option Explicit
'------------------------------------------------------------
' Copy_Of_allstock_formpic
'
'------------------------------------------------------------
Function Copy_Of_allstock_formpic()
On Error GoTo Copy_Of_allstock_formpic_Err
If (Eval("[imagepath] Is Null And [picture_name] Is Null")) Then
Beep
MsgBox "You need to specify the record path and image name with suffix", vbOKOnly, ""
DoCmd.CancelEvent
End If
If (Eval("[imagepath] Is Null And [picture_name] Is Not Null")) Then
Beep
MsgBox "You need to specify the path for the image", vbOKOnly, ""
DoCmd.CancelEvent
End If
If (Eval("[picture_name] Is Null And [imagepath] Is Not Null")) Then
Beep
MsgBox "You need to specify the name of the picture with suffix", vbOKOnly, ""
DoCmd.CancelEvent
End If
If (Eval("[imagepath] Is Not Null And [picture_name] Is Not Null")) Then
Forms!allstockrecord!Picture.Picture = Forms!allstockrecord!Imagepath & "\" & Forms!allstockrecord!picture_name & ".jpg"
End If
Copy_Of_allstock_formpic_Exit:
Exit Function
Copy_Of_allstock_formpic_Err:
MsgBox Error$
Resume Copy_Of_allstock_formpic_Exit
End Function
'------------------------------------------------------------
' Copy_Of_allstock_reppic
'
'------------------------------------------------------------
Function Copy_Of_allstock_reppic()
On Error GoTo Copy_Of_allstock_reppic_Err
If (Eval("[Picture] Is Not Null")) Then
Reports![select record r]!reppic.Picture = Reports![select record r]!Picture
End If
Copy_Of_allstock_reppic_Exit:
Exit Function
Copy_Of_allstock_reppic_Err:
MsgBox Error$
Resume Copy_Of_allstock_reppic_Exit
End Function
'------------------------------------------------------------
' Copy_Of_allstock_Newpic
'
'------------------------------------------------------------
Function Copy_Of_allstock_Newpic()
On Error GoTo Copy_Of_allstock_Newpic_Err
If (Eval("[imagepath] Is Null And [picture_name] Is Null")) Then
Beep
MsgBox "You need to specify the record path and image name with suffix", vbOKOnly, ""
DoCmd.CancelEvent
End If
If (Eval("[imagepath] Is Null And [picture_name] Is Not Null")) Then
Beep
MsgBox "You need to specify the path for the image", vbOKOnly, ""
DoCmd.CancelEvent
End If
If (Eval("[picture_name] Is Null And [imagepath] Is Not Null")) Then
Beep
MsgBox "You need to specify the name of the picture with suffix", vbOKOnly, ""
DoCmd.CancelEvent
End If
If (Eval("[imagepath] Is Not Null And [picture_name] Is Not Null")) Then
Forms![new Record f]!Picture.Picture = Forms![new Record f]!Imagepath & "\" & Forms![new Record f]!picture_name
End If
Copy_Of_allstock_Newpic_Exit:
Exit Function
Copy_Of_allstock_Newpic_Err:
MsgBox Error$
Resume Copy_Of_allstock_Newpic_Exit
End Function
'------------------------------------------------------------
' Copy_Of_allstock_reset
'
'------------------------------------------------------------
Function Copy_Of_allstock_reset()
On Error GoTo Copy_Of_allstock_reset_Err
DoCmd.SetWarnings False
DoCmd.OpenQuery "reset select q", acViewNormal, acEdit
Copy_Of_allstock_reset_Exit:
Exit Function
Copy_Of_allstock_reset_Err:
MsgBox Error$
Resume Copy_Of_allstock_reset_Exit
End Function