Here is an example on what Galaxiom is trying tell you
psudocode:
Dim blnConnected As Boolean
Dim dbConnection As DAO.Recordset
Sub MainLink()
'Loop ODBCTables
...your loopcode goes here
' end loop
blnConnected = False
dbConnection = Nothing
End Sub
Function IsODBCConnected(TableName...
No a commandbutton when it's clicked moves the focus to that record and makes it the current record so you can refrence the correct record in your code. By making it transparent your users will think they are clicking an image, but the button has to be on top of the image and NOT underneath for...
Why don't you create 3 commandbuttons and place these over your images, and use the commandbuttons Click_Event to execute your code.
Just set the commandbuttons backstyle property to Transparent to "hide" them.
Just a thought.
JanR
FYI the order of mathematical operations is different for a computer than a human.
For a human this:
2+2*4 = 16
A computer will look at the same expression and conclude that the answer is 10.
2*4+2 = 10
Be explicit in the order you do the math.
(2+2)*4=16
Regards
JanR
This should get you started.
Function Phases(CurPhase As Variant, NumOfDays As Integer) As String
Select Case CurPhase
Case "Phase 1", "Phase 3a", "Phase 5", "Phase 6"
If NumOfDays > 5 Then
Phases = "RED"
ElseIf NumOfDays > 3 Then...
Look into Update query with an Inner Join on you ID field on both tables.
something like this perhaps:
Update Table1 Inner Join Table2 On table1.ID=Table2.ID
Set table1.Price=table2.price, Table1.[Date_]=Table2[Date_];
Btw a fieldname like Date_ not a good idea, just saying.
JanR
Try and call the Function in the Open event of your subform also, it should work.
The subform will load before your mainform and be dumped in your subformcontrol on your main form.
JanR
You can wrap your DMin Expression using the Str() function.
DLookup("Id_Rozklad", "tblRozklad", "sna = " & Str(DMin("sna", "tblRozklad")))
works ok in my test
JR
You can't change a constant during runtime, so dim message1 as String.
Private Sub cboCategory_NotInList(NewData As String, Response As Integer)
Dim Message1 As String
Message1 = "The data you have entered " & me.cbocategory.text & " is not in the current dataset."
Const Message2 = "Add now?"...
you did not copy exactly what was in the code.
...
For Each fld In rst.Fields
ApXL.ActiveCell = fld.Name
ApXL.ActiveCell.Offset(0, 1).Select
Next
rst.MoveFirst
xlWSh.Range("A2").CopyFromRecordset rst
...
the line rst.MoveFirst should be on the next line
JR
You can use this code from the same site to export a forms recordset instead of a saved query.
http://btabdevelopment.com/export-a-forms-recordset-to-excel/
Godd luck
JR
You forgot quotes around the choises.
try:
Switch([Receiving].[Pdate]>[Allpos].[Delivery],"Late",[Receiving].[Pdate]=[Allpos].[Delivery],"Same",[Receiving].[Pdate]<[Allpos].[Delivery],"Before") JR
To update a table field with values from an other table you use an updatequery with an inner join on the field that links the two tables together.
ex:
UPDATE Table1 INNER JOIN Table2 ON Table1.SomeUniqueField = Table2.SomeUniqueField
SET Table1.Field1 = Table1.Field1 + Table2.Field2
That way...
You want to add new persons as well as updating old records?
Considery an update query where you do an outer join (left or right) on firstname and lastname and DOB. (see attached image for a visual example)
Query SQL:
UPDATE NewData LEFT JOIN LiveData ON (NewData.FirstName =...
Since your regional settings uses comma as a decimal seperator for numbers and Jet/Ace-engine expect a period as seperator it will fail.
solution 1 is to wrap 'nieuweprijs' with the Str() function to covert the number into something the engine can understand
... & Str(Nieuweprijs) & ...
Switch the join to tblSource.SourceID = tblDestiantion.DestID
UPDATE tblSource LEFT JOIN tblDestination ON tblSource.SourceID = tblDestination.DestID SET tblDestination.SomeText = [tblSource].[SomeSourceText], tblDestination.MyDestID = [tblSource].[mYSourceID]; and you get this table:
DestID...